Re: [Maria-developers] 6d0c1f3ae12: MDEV-23328 Server hang due to Galera lock conflict resolution

2021-10-24 Thread Sergei Golubchik
k THD::LOCK_thd_data to protect from > + concurrent usage or disconnect or delete. */ > + DEBUG_SYNC(bf_thd, "wsrep_before_BF_victim_lock"); > + my_sleep(10); Eh? Forgot to remove after debugging? > + wsrep_thd_LOCK(thd); > + my_sleep(10); and

Re: [Maria-developers] dfa33fb309d: MDEV-26664 Store UUIDs in a more efficient manner

2021-10-21 Thread Sergei Golubchik
Hi, Alexander! On Oct 21, Alexander Barkov wrote: > > On 10/20/21 2:48 AM, Sergei Golubchik wrote: > >> 2000----0002 > >> +1000----0003 > >> 2000----0003 > > > > please, add

Re: [Maria-developers] dfa33fb309d: MDEV-26664 Store UUIDs in a more efficient manner

2021-10-19 Thread Sergei Golubchik
+ Data type implementations that need different representations > + can override the default implementation (like e.g. UUID does). > */ thanks, this is very good > > /*******/ > @@ -64,5

Re: [Maria-developers] 688ad5ed67f: MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with CHECK violation

2021-10-18 Thread Sergei Golubchik
/* > @@ -1125,7 +1127,6 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list, >if (unlikely(error)) > break; >info.accepted_rows++; > - thd->get_stmt_da()->inc_current_row_for_warning(); > } > its.rewind(); > iteration++;

Re: [Maria-developers] a895fce3277: MDEV-26842: MDEV-26842: ROW_NUMBER is not set and differs from the message upon WARN_DATA_TRUNCATED produced by inplace ALTER

2021-10-17 Thread Sergei Golubchik
in the commit comment that it's for INPLACE alter, where the server cannot know what row has generated the warning, so the value of current_row is supplied by the engine. >if (thd->count_cuted_fields > CHECK_FIELD_EXPRESSION) >{ >

Re: [Maria-developers] 351a0a7d6b7: MDEV-26841: ROW_NUMBER is not set and differs from the message upon ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row

2021-10-17 Thread Sergei Golubchik
>my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L); >DBUG_RETURN(-1); > } Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : ma

Re: [Maria-developers] 8a84f5a40c1: MDEV-24176 Preparations

2021-10-17 Thread Sergei Golubchik
ven > if > + table_name is alias! It cannot be TRUE in these cases, lots of spaghetti > + logic depends on that. could you elaborate on that? > + */ >bool alias_name_used; /* true if item was resolved against alias */ >/* > Cached value of index for this field

Re: [Maria-developers] fcf2c5fff14: MDEV-26299: Some views force server (and mysqldump) to generate invalid SQL for their definitions

2021-10-16 Thread Sergei Golubchik
ce to > table name rules, but we do it on parsing. A derived table is still a table. But item->name isn't a name of a defived, it's a name of the item. check_table_name is just incorrect there, it will reject valid column names and will accept invalid column names. A check_column_name funct

Re: [Maria-developers] fcf2c5fff14: MDEV-26299: Some views force server (and mysqldump) to generate invalid SQL for their definitions

2021-10-16 Thread Sergei Golubchik
t; + !check_table_name(item->name, len, TRUE)) why check_table_name() if it isn't a table? it's an incorrect check to use for columns. > +item->print_item_w_name(str, query_type); > + else > +item->print(str, query_type); > +} >} > >/* > Regards

Re: [Maria-developers] baaaa971662: MDEV-22883: Assertion `!parse_error || lex.sphead == 0' failed in Table_triggers_list::check_n_load | SIGSEGV in strxmov

2021-10-15 Thread Sergei Golubchik
_QUERY) > +if (thd->killed == ABORT_QUERY || thd->is_fatal_error) > { >error= 0; >goto err; that's kind of weird. Why does it continue executing if the statement is killed? Perhaps it'd better be if (thd->killed || thd->is_fa

Re: [Maria-developers] 2f812e800c0: MDEV-22447: SIGSEGV in Item::val_uint on EXPLAIN

2021-10-15 Thread Sergei Golubchik
gt;limit_rows_examined->val_uint()); > +thd->lex->get_limit_rows_examined()); > thd->abort_on_warning= saved_abort_on_warning; > thd->reset_killed(); >} How comes, it gets into ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT if limi

Re: [Maria-developers] cd4cac2b95a: MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action

2021-10-15 Thread Sergei Golubchik
est case. DROP ROLE would not clear all necessary role->role or > role->user mappings. > > To fix the problem we ensure that the scan is restarted, only if an > element was deleted / updated, similar to how bubble-sort keeps > sorting until it f

Re: [Maria-developers] 97458a7767b: MDEV-26832: ROW_NUMBER in SIGNAL/RESIGNAL causes a syntax error

2021-10-15 Thread Sergei Golubchik
ame); >copy_string(m_mem_root, & m_cursor_name, & cond->m_cursor_name); > + copy_value(& m_row_number, & cond->m_row_number); That makes no sense. Other values were strings and had to be strdup-ed, but that's a number, you can simply do m_row_number= cond

Re: [Maria-developers] 6ec64caec5d: MDEV-26650: Failed ALTER USER/GRANT statement removes the password from the cache

2021-10-15 Thread Sergei Golubchik
the password from the > cache > > Starting from 10.4 AUTH is not part of ACL_USER so changes have to be done > over a copy, and bring in the cache only in case of success. > Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org __

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-15 Thread Sergei Golubchik
ar, it has to release those locks first. And you own the lock->mutex. So the THD isn't going anywhere until you return from thr_lock(). > (6) Please note that fix will not be ready 19th of October as we again > change critical path, Ramesh will run QA with pquery sure > On Thu,

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-14 Thread Sergei Golubchik
ut I didn't try to run it, it's only to show the idea, not a working fix (I already suspect I removed too much from wsrep_abort_transaction()). Note it's the patch for 10.2 at the commit 29bbcac0ee8^ - that is one commit before my fix. On Oct 12, Jan Lindström wrote: > Hi S

Re: [Maria-developers] MDEV-26742 Assertion `field->type_handler() == this' failed...

2021-10-12 Thread Sergei Golubchik
t; > code. And an assert that will remind us to implement your gneralized > > approach when the assumption will be broken. > > This code is not heavily loaded and should not affect performance. > I prefer the generic way. Feels like kind of a waste. We won't need this

Re: [Maria-developers] MDEV-26742 Assertion `field->type_handler() == this' failed...

2021-10-12 Thread Sergei Golubchik
em->type_handler_for_comparison() != _handler_long_blob > > > > won't do? > > We don't know. It's for a plugin to decide if its data type > is stronger of weaker than CHAR/VARCHAR/TEXT. > For INET6 and UUID we decided they are stronger. > But eventually we may want to

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-11 Thread Sergei Golubchik
while we are here or > disconnect will not free THD. > > I created a new mtr-test (galera_to_error) also for the TOI error case and > verified that after that you can't issue statements anymore > including KILL QUERY. > > R: Jan Regards, Sergei VP of MariaDB Server Engineering

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-11 Thread Sergei Golubchik
Hi, Jan! On Oct 10, Jan Lindström wrote: > Hi Sergei, > > > > > if (victim_trx) { > > > const trx_id_t victim_trx_id= victim_trx->id; > > > const longlong victim_thread= thd_get_thread_id(victim_thd); > > > /* This is necessary as cor

Re: [Maria-developers] MDEV-26742 Assertion `field->type_handler() == this' failed...

2021-10-11 Thread Sergei Golubchik
son() && > - return item->cmp_type() == STRING_RESULT && > charset() == cond->compare_collation(); This, basically, means, that cmp_type() is now meaningless, one cannot use it anymore? There's no INET6_RESULT and UUID_RESULT for comparison, so what's the point of cmp_type()

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-08 Thread Sergei Golubchik
G_VOID_RETURN; > } > > > > > By the way, how long can WSREP_TO_ISOLATION_BEGIN() take? > > > > Does it need to wait for everything else being replicated? > > > > > > As long as it takes to start it on all nodes in the cluster. > > > > So, KILL bas

Re: [Maria-developers] dcbdec60893: MDEV-26650: Failed ALTER USER/GRANT statement removes the password from the cache

2021-10-07 Thread Sergei Golubchik
py constructor (protect from non-authorized usage) "shallow" > + ACL_USER(const ACL_USER &)= default; > public: Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launch

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-06 Thread Sergei Golubchik
wsrep_srv_conc_cancel_wait(victim_trx); > DBUG_VOID_RETURN; I don't understand, sorry. It's not quite clear what this patch should apply to. May be you can paste what the new code should look like, not a patch? In particular, where are wsrep_thd_UNLOCK and wsrep_thd_LOCK. Are th

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-06 Thread Sergei Golubchik
Hi, Jan! On Oct 04, Jan Lindström wrote: > Hi Sergei, > > > +/* This is wrapper for wsrep_break_lock in thr_lock.c */ > > > +static int wsrep_thr_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, > > > my_bool signal) > > > +{ > > > + THD* victim_

Re: [Maria-developers] 4b164f176e6: MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

2021-10-01 Thread Sergei Golubchik
> signal); > lock_mutex_exit(); > trx_mutex_exit(victim_trx); > wsrep_srv_conc_cancel_wait(victim_trx); > +wsrep_thd_LOCK(victim_thd); > DBUG_VOID_RETURN; > } else { > -wsrep_thd_LOCK(v

Re: [Maria-developers] 4156071ebe2: MDEV-26606: ERROR_INDEX property value isn't passed from inside a stored procedure

2021-09-28 Thread Sergei Golubchik
sh_warning(THD *thd, > @@ -1191,7 +1194,7 @@ class Diagnostics_area: public Sql_state_errno, >const char* msg) >{ > return push_warning(thd, sqlerrno, sqlstate, level, > -Sql_user_condition_identity(), ms

Re: [Maria-developers] b248988c8b6: MDEV-19275 Provide SQL service to plugins.

2021-09-14 Thread Sergei Golubchik
uot;sql_class.h" == Let's just accept that *if* one wants to include my_global.h, it *has* to be included first. As Monty wants to be the case anyway. On Sep 14, Alexey Botchkov wrote: > Hi, Sergei. > > Unfortunately the taken ap

Re: [Maria-developers] b248988c8b6: MDEV-19275 Provide SQL service to plugins.

2021-09-13 Thread Sergei Golubchik
Hi, Alexey! Looks good to me, thanks. Please tell Sanja to rebase on top of that, push the result into a preview-* branch, and update the TODO. > So the patch with the abovementioned changes. > 9ad45b41d385fca8215880cce1757ebe7f2396eb > Regards, Sergei VP of MariaDB Server Engineering

Re: [Maria-developers] 48261114b9d: MDEV-26572 Improve simple multibyte collation performance on the ASCII range

2021-09-11 Thread Sergei Golubchik
orms. > + There is no sense to perform my_ascii_to_upper_magic_uint64() based > + optimization on 32bit platforms. The idea of this optimization > + is that it handles 8bytes at a time, using a 64bit CPU register. > + Enabling this optimization on 32bit platform may only

Re: [Maria-developers] a00410a2ee4: MDEV-26238: Remove inconsistent behaviour of --default-* options in my_print_defaults

2021-09-11 Thread Sergei Golubchik
_argv[index++]= *(pos); > >new_argv[index]= 0; >argc= index; > >memcpy((char*)argv, (char*)new_argv, index*(sizeof(*new_argv))); > >/* Check out the args. */ >if (get_options(,)) > cleanup_and_exit(1); > >nargs= argc + 1; >if (opt

Re: [Maria-developers] 0e09bc41cba: MDEV-9245 password "reuse prevention" validation plugin

2021-09-11 Thread Sergei Golubchik
No tests for that? You can, for example, drop the table, and create a non-insertable view with the same name. CREATE VIEW mysql.password_reuse_check_history AS SELECT 1; That should make the plugin to fail, right? > + > + > +/** > + Crea

Re: [Maria-developers] eb121bbe93e: Vanilla cleanups and refactorings

2021-09-10 Thread Sergei Golubchik
Hi, Aleksey! On Sep 10, Aleksey Midenkov wrote: > On Fri, Sep 10, 2021 at 9:32 PM Sergei Golubchik wrote: > > On Sep 10, Aleksey Midenkov wrote: > > > revision-id: eb121bbe93e (mariadb-10.6.1-78-geb121bbe93e) > > > parent(s): d90f54e2206 > > > author: Aleks

Re: [Maria-developers] ff0ece70855: MDEV-26531: mtr shows some hunks failed

2021-09-10 Thread Sergei Golubchik
sub report_failure_and_restart ($) { > > sub run_system(@) { >mtr_verbose("Running '$_[0]'"); > - my $ret= system(@_) >> 8; > + my $ret= system(@_); this seems wrong. `perldoc -f system` says The return value is the exit status of the program as returned by

Re: [Maria-developers] 818407474d6: MDEV-22166 CONVERT PARTITION: move out partition into a table

2021-09-10 Thread Sergei Golubchik
+} as I wrote earlier, this is wrong. DBUG_SUICIDE() must always be an expression. > + > +#define ERROR_INJECT_CRASH(code) \ > + (DBUG_IF(code) && suicide()) > +#define ERROR_INJECT_ERROR(code) \ > + (DBUG_IF(code) && (my_error(ER_UNKNOWN_ERROR, MYF(0)), 1))

Re: [Maria-developers] eb121bbe93e: Vanilla cleanups and refactorings

2021-09-10 Thread Sergei Golubchik
? (a1) : (a2)) > +#define DBUG_EVALUATE_IF(keyword,a1,a2) \ > +(_db_keyword_(0,(keyword), 1) ? (a1) : (a2)) > +#else > +#define DBUG_EVALUATE(keyword,a1,a2) (a2) > +#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2) > +#endif > + could you fix the test properly, plea

Re: [Maria-developers] 4645a1e1950: MDEV-26238: Remove inconsistent behaviour of --default-* options in my_print_defaults

2021-09-10 Thread Sergei Golubchik
Hi, Rucha! On Sep 08, Rucha Deodhar wrote: > Hi, Sergei ! > Thanks for the review. > > > > diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c > > > index b7f52382721..e2ec0b00923 100644 > > > --- a/extra/my_print_defaults.c > > > ++

Re: [Maria-developers] b248988c8b6: MDEV-19275 Provide SQL service to plugins.

2021-09-10 Thread Sergei Golubchik
TRUE; > > + thd->set_time(); why? May be it should be executed using the timestamp of the top-level statement? > thd->set_n_backup_statement(this, _backup); >thd->set_n_backup_active_arena(this, _backup); >thd->stmt_arena= this; Regards, Sergei VP of MariaDB S

Re: [Maria-developers] 4645a1e1950: MDEV-26238: Remove inconsistent behaviour of --default-* options in my_print_defaults

2021-09-07 Thread Sergei Golubchik
; handle_options() > + instead of original commandline. > + */ > + new_argv= (char**)malloc(argc*sizeof(*org_argv)); > + for (pos= org_argv; *pos; pos++) >{ > +if (!is_prefix(*pos, "--defaults-extra-file=") && > + !is_prefix(*pos, "--de

Re: [Maria-developers] 9e1c15355a9: resolve the possible deadlock issue through intern_plugin_lock

2021-09-07 Thread Sergei Golubchik
t;variables.dynamic_variables_head) > + { > +mysql_prlock_rdlock(_system_variables_hash); > +sync_dynamic_session_variables(safe_thd, false); > +mysql_prlock_unlock(_system_variables_hash); > + } > + mysql_mutex_unlock(_global_system_variables); >

Re: [Maria-developers] ca4ef7185da: MDEV-9245 password "reuse prevention" validation plugin

2021-09-07 Thread Sergei Golubchik
ode that doesn't allow to create users with grant? I don't see where you've disabled that. > + > +#--error ER_NOT_VALID_PASSWORD > +#grant select on *.* to user_name@localhost identified by 'test_pwd'; > +#show warnings; why is that commented out? > + > +--er

Re: [Maria-developers] 271afbc88e4: Pre requiste MDEV-9245: add host to validate password interface

2021-09-07 Thread Sergei Golubchik
iste MDEV-9245: add host to validate password interface > > Hostname added to the interface. > > Cracklib plugin fixed according to the new interface. > Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mai

Re: [Maria-developers] b248988c8b6: MDEV-19275 Provide SQL service to plugins.

2021-09-07 Thread Sergei Golubchik
y_result(MYSQL *mysql) > + > extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql, > -const char *host, const char *user, const char *passwd, const char *db) > +const char *host, const char *user, const char *db, you aren't using `host` or `db` for anything. And I don't

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-07 Thread Sergei Golubchik
.test or any traces of EXTRACT neither. I suspect you broke dbug-t unit test, please, verify that it passes. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-06 Thread Sergei Golubchik
you can consider this argument and still prefer DBUG_IF. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubsc

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-04 Thread Sergei Golubchik
Hi, Aleksey! On Aug 26, Sergei Golubchik wrote: > > > > > > ALTER ... MOVE TABLE table_name TO PARTITION (...) > > > ALTER ... MOVE PARTITION ... TO TABLE table_name > > > > > There is no MOVE symbol and we should not add a new one be

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-02 Thread Sergei Golubchik
Hi, Aleksey! On Sep 01, Aleksey Midenkov wrote: > On Wed, Sep 1, 2021 at 10:20 PM Sergei Golubchik wrote: > > On Sep 01, Aleksey Midenkov wrote: > > > > > > > > > > Looks like IF_DBUG is superfluous macro and should be replaced by > > >

Re: [Maria-developers] b48dfdedd59: MDEV-26307 multi-source-replication support mysql syntax(for channel)

2021-09-02 Thread Sergei Golubchik
al_connection_name slave_thread_opts > + START_SYM SLAVE optional_connection_name slave_thread_opts > optional_for_channel >{ > LEX *lex=Lex; > lex->sql_command = SQLCOM_SLAVE_START; Regards, Sergei VP of MariaDB Server Engineering a

Re: [Maria-developers] dc2ace70f1b: Syntax with MIGRATE keyword

2021-09-01 Thread Sergei Golubchik
Hi, Aleksey! On Sep 01, Aleksey Midenkov wrote: > On Wed, Sep 1, 2021 at 10:13 PM Sergei Golubchik wrote: > > On Sep 01, Aleksey Midenkov wrote: > > > > > > > > > > +move_out_partition: > > > > > +MIGRATE_SYM PARTITION_SYM

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-01 Thread Sergei Golubchik
ER_KEY_DOES_NOT_EXIST > >ER_KEY_COLUMN_DOES_NOT_EXIST > >ER_PARTITION_DOES_NOT_EXIST > >ER_REORG_PARTITION_DOES_NOT_EXIST > > That is longer by the whole useless word... It correct grammar. Messages looking bad otherwise. Or, better, don't

Re: [Maria-developers] dc2ace70f1b: Syntax with MIGRATE keyword

2021-09-01 Thread Sergei Golubchik
trict user freedom to choose between verbosity and > brevity. I guess you have a preference for perl over python (and the > democracy over dictatorship). I do. But it's SQL, not perl. SQL is very verbose even when it isn't really justified. And here is is justified, so let's keep the syntax

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-01 Thread Sergei Golubchik
$ grep -c DOES_NOT_EXIST sql/share/errmsg-utf8.txt 6 $ grep -c NOT_EXIST sql/share/errmsg-utf8.txt 7 So only one existing error message uses NOT_EXIST without DOES. Let's keep the conventional naming. So, it should be ER_KEY_DOES_NOT_EXIST ER_KEY_COLUMN_DOES_NOT_EXIST ER_PARTITION_DOES_NOT_EXIST ER_REORG_PARTITI

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-01 Thread Sergei Golubchik
tomicity was implemented differently from what I've described? Then I'm sorry, I didn't intend to suggest that you should implement yet another approach to DDL atomicity, I was saying, please, do what other statements do. Regards, Sergei VP of MariaDB Server Engineering and secur...@ma

Re: [Maria-developers] 19fbfab084f: Compilation fix

2021-09-01 Thread Sergei Golubchik
Hi, Aleksey! On Sep 01, Aleksey Midenkov wrote: > On Wed, Sep 1, 2021 at 3:46 PM Sergei Golubchik wrote: > > Here > > #define DBUG_SUICIDE() do { } while(0) > > DBUG_SUICIDE is not an expression. It's a statement and cannot be used > in expression.

Re: [Maria-developers] dc2ace70f1b: Syntax with MIGRATE keyword

2021-09-01 Thread Sergei Golubchik
Lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_alter_table(); > if (unlikely(Lex->m_sql_cmd == NULL)) >MYSQL_YYABORT; > -Lex->alter_info.partition_flags|= ALTER_PARTITION_EXTRACT; > +Lex->alter_info.partition_flags|= ALTER_PARTITION_MIGRATE_OU

Re: [Maria-developers] 87953156c76: Vanilla cleanup: DBUG_EVALUATE_IF() macro replaced by shorter form DBUG_IF()

2021-09-01 Thread Sergei Golubchik
with DBUG_EVALUATE_IF. And DBUG_EVALUATE is not used anywhere, I've just grepped. Remove it too? > -#define DBUG_EVALUATE_IF(keyword,a1,a2) \ > -(_db_keyword_(0,(keyword), 1) ? (a1) : (a2)) > +#define DBUG_IF(keyword) _db_keyword_(0, (keyword), 1) > #define DBUG_PRINT(keyword,arglist) \ >

Re: [Maria-developers] 19fbfab084f: Compilation fix

2021-09-01 Thread Sergei Golubchik
// LEX_CUSTRING > > +inline bool suicide() > +{ > + DBUG_SUICIDE(); > + return false; > +} > + > #define ERROR_INJECT_CRASH(code) \ > - (DBUG_IF(code) && (DBUG_SUICIDE(), 0)) > + (DBUG_IF(code) && suicide()) What did that change? A co

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-09-01 Thread Sergei Golubchik
Hi, Aleksey! On Aug 30, Aleksey Midenkov wrote: > Hi Sergei! > > Updated bb-10.7-midenok-MDEV-22166 is d4668e7254c6 I'll look right after replying to this email. > > Okay, indeed, it seems that DBUG_EVALUATE_IF is almost always used with > > one of the arguments being 0

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-08-27 Thread Sergei Golubchik
Hi, Aleksey! On Aug 26, Aleksey Midenkov wrote: > Hi Sergei! > > The updated branch is cabd0530 bb-10.7-midenok-MDEV-22166 Commits cabd0530426 Parser refactoring db69d4eb025 Cleanups are fine, thanks. The main change in the simplified diff is: > diff --git a/sql/log_event_ser

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-08-26 Thread Sergei Golubchik
log) && > > > + (write_bin_log(thd, FALSE, > > > +thd->query(), thd->query_length()), FALSE)) || > > > > if you crash here, what will roll forward on recovery and > > drop the backup? The log is already closed here

Re: [Maria-developers] 6768e3a2830: MDEV-22166 MIGRATE PARTITION: move out partition into a table

2021-08-25 Thread Sergei Golubchik
TITION)) > diff --git a/mysql-test/include/lcase_names.inc > b/mysql-test/include/lcase_names.inc > new file mode 100644 > index 000..e69de29bb2d better put here some comment, like in other dummy *.inc files see e.g. platform.inc or protocol.inc > diff --git a/mysql-test/suite/atomi

Re: [Maria-developers] f14cfd22115: Vanilla refactoring: binlog query in DDL_LOG_RENAME_ACTION

2021-08-24 Thread Sergei Golubchik
Hi, Aleksey! On Aug 24, Aleksey Midenkov wrote: > Hi Sergei! > > Really, this is not pure refactoring. I've been planning to remove it > if it will not be useful for MDEV-22165 (that task should be based on > this branch). Meanwhile, can you please review other commits? Yes, I'm

Re: [Maria-developers] bc55e3c438f: MDEV-4742 - provide function to sort string in "natural" order

2021-08-20 Thread Sergei Golubchik
wed_packet); > +goto error_exit; > + } > + return s; > + > +error_exit: > + null_value=true; > + return nullptr; > +} > + > + > +my_wc_t Item_func_natural_sort_key::decimal_separator() > +{ > + if (m_decimal_separator != DECIMAL_SEP_UNDEFIN

Re: [Maria-developers] a19495728de: MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables

2021-08-15 Thread Sergei Golubchik
estamp, my_progname_short); Because MariaDB [test]> select timestamp'2010!@#$%'; ERROR 1525 (HY000): Incorrect DATETIME value: '2010!@#$%' > +return(EX_USAGE); > + } >if (strcmp(default_charset, charset_info->csname) && >!(charset_info= get_charset

Re: [Maria-developers] cdb6db8ce38: MDEV-25444 mysql --binary-mode is not able to replay some mysqlbinlog outputs

2021-08-14 Thread Sergei Golubchik
just remove the if? I tried, at least > > the main suite didn't break. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.

Re: [Maria-developers] Pushing down aggregation functions

2021-08-04 Thread Sergei Golubchik
rst, > I would only push down functions if they operate over just one column > of the same table. Things can be made more complicated in the future, > of course. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing li

Re: [Maria-developers] 203aa38f9b6: MDEV-26102: gcov 9.1 doesn't support intermediate format any more, but json instead - refactoring needed

2021-07-29 Thread Sergei Golubchik
erent (I haven't seen 'lcount' to have the same > line_number), so the hash is different and += doesn't take effect. it's for the case like, say, THD::exit_cond() - an inline method defined in sql_class.h. It's included in many .cc files and many *.gcov files will have lcount data fo

Re: [Maria-developers] ce289840131: MDEV-24511 null field is created with CREATE..SELECT

2021-07-28 Thread Sergei Golubchik
safer and more logical to fix specifically field creation for UNION. I've discussed it with Bar, who implemented this whole Type_handler hierarchy, he suggested to use Type_handler::union_element_finalize() for that. I've attached the patch that does that. union_element_finalize() is for 10.4,

Re: [Maria-developers] 203aa38f9b6: MDEV-26102: gcov 9.1 doesn't support intermediate format any more, but json instead - refactoring needed

2021-07-28 Thread Sergei Golubchik
$gcov_file_json; > +gunzip "$_.gcov.json.gz" => \$gcov_file_json or die > "gunzip($_.gcov.json.gz): $GunzipError"; > +my $obj= decode_json $gcov_file_json; > +for my $file (@{$obj->{files}}) { > + $fname= $file->{file}; and write `my $

Re: [Maria-developers] c34533186ab: MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table

2021-07-26 Thread Sergei Golubchik
t; + } > > > + table->move_fields(table->field, table->record[0], rec_buf); > > > > On swap_blobs() you always move all fields from rec_buf to table->record[0]? > > Why? > > This looks very suspicious. > > Have you seen the first move_fields() ca

Re: [Maria-developers] c4835af7e8c: MDEV-16026: Forbid global system_versioning_asof in non-default time zone

2021-07-26 Thread Sergei Golubchik
OF' time > is applied and `now()` can be assumed > Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : http

Re: [Maria-developers] a4a5c2d5963: MDEV-25908: -e does not work for my_print_defaults

2021-07-26 Thread Sergei Golubchik
4e0ec4686 ^ This is wrong, please, remove it from your commit Otherwise ok to push Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-develop

Re: [Maria-developers] 412e696fd2b: MDEV-25395 server recovery hits replication event checksum error

2021-07-23 Thread Sergei Golubchik
binlog file that contains > events which can't pass checksum verification. > A work-around is done to accept that binlog and evade recovery. > > binlog_recover_checksum_error needed refinement as > the master-checksum-verify configured server is made to stop >

Re: [Maria-developers] 1c7d4f9c06f: MDEV-25282 Auto-shutdown on idle when socket-activated

2021-07-23 Thread Sergei Golubchik
l die after interactive_timeout or wait_timeout. And then you shutdown the server after max_idle_execution. So instead of shutting down the server when there are connections, I'd suggest to autoset interactive_timeout and wait_timeout to be in line with max_idle_execution. Like, 10 mins, or, may be if (IS_SY

Re: [Maria-developers] ae1f4e4d727: MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)

2021-07-23 Thread Sergei Golubchik
Hi, Rucha! On Jul 23, Rucha Deodhar wrote: > On Fri, Jul 23, 2021 at 1:55 PM Sergei Golubchik wrote: > > > > Consider this - thd->killed can be changed literally any time. We cannot > > test for it after every second line, can we? Clearly some places are > > be

Re: [Maria-developers] ae1f4e4d727: MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)

2021-07-23 Thread Sergei Golubchik
e before the warning? or after it.remove() ? Consider this - thd->killed can be changed literally any time. We cannot test for it after every second line, can we? Clearly some places are better for this test than others. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org

Re: [Maria-developers] ae1f4e4d727: MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)

2021-07-22 Thread Sergei Golubchik
xeceeds > + maximum session memory used), return TRUE and do rollback (done > later). > +*/ > +if (thd->killed) > + DBUG_RETURN(true); > it.remove(); Looks like a completely arbitrary place to put a check in.

Re: [Maria-developers] f5196787294: MDEV-23178: Qualified asterisk not supported in INSERT .. RETURNING

2021-07-22 Thread Sergei Golubchik
ields instead of '*' for qualified asterisk in RETURNING, > use first_name_resolution_table for correct resolution of item. > Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers P

Re: [Maria-developers] d91c4eea668: MDEV-23178: Qualified asterisk not supported in INSERT .. RETURNING

2021-07-22 Thread Sergei Golubchik
first; TABLE_LIST *TABLE_LIST::* next; if (returning_field || !table_name) or reverse your condition: TABLE_LIST *first= context->first_name_resolution_table; TABLE_LIST *TABLE_LIST::* next= _LIST::next_name_resolution_table; if (table_name &&

Re: [Maria-developers] 5e16a49f5d9: MDEV-26013 distinct not work properly in some cases for spider tables

2021-07-22 Thread Sergei Golubchik
Hi, Nayuta! Ok to push. Thanks! On Jul 22, Nayuta Yanagisawa wrote: > Hi Sergei! > > > I agree, it is wrong that implicit GROUP BY has no place in the Query > > structure. Does Spider work correctly for, say, `SELECT COUNT(*)` or > > `SELECT SUM(a)` - that is, for othe

Re: [Maria-developers] 5e16a49f5d9: MDEV-26013 distinct not work properly in some cases for spider tables

2021-07-21 Thread Sergei Golubchik
Hi, Nayuta! On Jul 21, Nayuta Yanagisawa wrote: > Hi Sergei, > > Thank you for your review! > > > If DISTINCT was coverted to a GROUP BY, why would the engine need to > > know whether there was DISTINCT or not originally? There is no > > DISTINCT on the e

Re: [Maria-developers] c34533186ab: MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table

2021-07-21 Thread Sergei Golubchik
cached(set_read_value); > + if (cached) > + { > +cached->swap(s.blob); > +s.set_read_value= set_read_value; > + } > + } > + } > + table->move_fields(table->field, table->record[0], rec_buf); On swap_blobs() you always move a

Re: [Maria-developers] 2f9bbf392072: MDEV-18734 optimization by taking ownership via String::swap()

2021-07-21 Thread Sergei Golubchik
Hi, Aleksey! On Jun 10, Aleksey Midenkov wrote: > On Thu, Jun 3, 2021 at 1:58 PM Sergei Golubchik wrote: > > Hi, Aleksey! > > > > On Jan 26, Aleksey Midenkov wrote: > > > On Tue, Dec 22, 2020 at 7:58 PM Sergei Golubchik wrote: > > &

Re: [Maria-developers] 5e16a49f5d9: MDEV-26013 distinct not work properly in some cases for spider tables

2021-07-21 Thread Sergei Golubchik
st, conds, group_list, order ? order : > group_list, having}; If DISTINCT was coverted to a GROUP BY, why would the engine need to know whether there was DISTINCT or not originally? There is no DISTINCT on the execution plan now, that should be sufficient, shouldn't it? Why does the query f

Re: [Maria-developers] 5d19829df5f: MDEV-25908: -e does not work for my_print_defaults

2021-07-21 Thread Sergei Golubchik
amp: 2021-07-15 13:29:25 +0530 > message: > > MDEV-25908: -e does not work for my_print_defaults > > Analysis: -e is very inconsistent with how --default* options work in any > other > executable. > Fix: Removed the support for -e starting from 10.7 to avoid inconsistency in

Re: [Maria-developers] 61dcf8d940c: MDEV-25908: -e does not work for my_print_defaults

2021-07-21 Thread Sergei Golubchik
that your commit passes buildbot, then ask for a review. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https:/

Re: [Maria-developers] cf6d83e7d68: MDEV-24760 SELECT..CASE statement syntax error at Spider Engine table

2021-07-21 Thread Sergei Golubchik
+id CASE name WHEN 'Alice' THEN "A" WHEN 'Bob' THEN "B" END > +1A > +2B a _very_ slight preference - could you use different names for local (spider) and remote tables? That is, by all means, please, follow the conventions that are used in existing spider tests. But if it

Re: [Maria-developers] 19aebbd1b89: MDEV-16481: set global system_versioning_asof=sf() crashes in specific case

2021-07-19 Thread Sergei Golubchik
Hi, Nikita! On Jul 19, Sergei Golubchik wrote: > > > The commits can be found at bb-10.3-nikita-old for now. > > I'll take a look The diff 19aebbd1b89fe^..01ab3db8c73 looks pretty good to me, ok to push Regards, Sergei VP of MariaDB Server Engineering and secur

Re: [Maria-developers] 19aebbd1b89: MDEV-16481: set global system_versioning_asof=sf() crashes in specific case

2021-07-18 Thread Sergei Golubchik
Hi, Nikita! On Jul 19, Nikita Malyavin wrote: > Hello, Sergei! > > 1. What you ask was done in 01ab3db8c7 "make all conversions in check() to > avoid possible errors". It was mentioned in the previous discussion btw I didn't review it, did I? All I have is 2d73406dad8:

Re: [Maria-developers] a11756e4fba: MDEV-23178: Qualified asterisk not supported in INSERT .. RETURNING

2021-07-16 Thread Sergei Golubchik
solution_table; + TABLE_LIST *TABLE_LIST::* next= _LIST::next_name_resolution_table; + if (table_name) + { +first= context->table_list; +next= _LIST::next_local; + } + for (TABLE_LIST *tables= first; tables; tables= tables->*next) { Field *field; TABLE *table= tables->tab

Re: [Maria-developers] 70252733d41: MDEV-25908: -e does not work for my_print_defaults

2021-07-15 Thread Sergei Golubchik
qld > mysql.server > +--echo # Testing --defaults-file > +--exec $MYSQL_MY_PRINT_DEFAULTS > --defaults-file=$MYSQLTEST_VARDIR/tmp/tmp2.cnf --mysqld mysql.server > + > +--echo # Testing -g option > +--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp3.cnf --mysqld

Re: [Maria-developers] 19aebbd1b89: MDEV-16481: set global system_versioning_asof=sf() crashes in specific case

2021-07-12 Thread Sergei Golubchik
gt; +} > +return (error != 0); >} > > public: >virtual bool global_update(THD *thd, set_var *var) >{ > -return update(var, global_var(vers_asof_timestamp_t), thd->variables); > +return update(thd, var, _var(vers_asof_timestamp_t)); >

Re: [Maria-developers] da70f190279: MDEV-25985 Spider handle ">=" as ">" in some cases

2021-07-12 Thread Sergei Golubchik
, > we could not simply convert HA_READ_AFTER_KEY to '>'. > > The correct conversion is to convert HA_READ_AFTER_KEY to '>' > only for the last column in key_part_map and to convert > HA_READ_AFTER_KEY to '>=' for the other column. > > The similar discussion also appli

Re: [Maria-developers] a6e96ce3c96: MDEV-21916: COM_STMT_BULK_EXECUTE with RETURNING insert wrong values

2021-07-12 Thread Sergei Golubchik
buffer we are reading > from. Regards, Sergei VP of MariaDB Server Engineering and secur...@mariadb.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad

Re: [Maria-developers] b1881e07797: MDEV-20131 Assertion `!pk->has_virtual ()' failed in instant_alter_column_possible

2021-07-12 Thread Sergei Golubchik
92: > +return 1536; > + default: > +return REC_VERSION_56_MAX_INDEX_COL_LEN; > + } dunno, why would you duplicate the whole switch logic? can you just - return(REC_VERSION_56_MAX_INDEX_COL_LEN); - return MY_MIN(max_supported_key_length(), REC_VERSION_56_MAX_IND

Re: [Maria-developers] 85186734823: MDEV-24248: my_print_defaults is not taking all the values when using -e

2021-07-12 Thread Sergei Golubchik
aults-file-name=$basedir/my.cnf" eh. -e is --defaults-extra-file same below. > else >if test -r "$datadir/my.cnf" >then > -extra_args="-e $datadir/my.cnf" > +extra_args="--defaults-file-name=$datadir/my.cnf" >fi > fi >

Re: [Maria-developers] cdb6db8ce38: MDEV-25444 mysql --binary-mode is not able to replay some mysqlbinlog outputs

2021-07-12 Thread Sergei Golubchik
he string, because of if (!real_binary_mode && strlen(line) != line_length) ... in other words, shouldn't we just remove the if? I tried, at least the main suite didn't break. > +break; // readline adds one '\' >if (*in_string || inch

Re: [Maria-developers] b3844107287: MDEV-16546 System versioning setting to allow history modification

2021-07-09 Thread Sergei Golubchik
> I set thd->lex->sql_command for check_update_fields() so it is > possible now to distinguish fix_fields() of INSERT from fix_fields() > of ODKU. I used the value of SQLCOM_UPDATE though it is probably good > to add something like SQLCOM_DUPKEY_UPDATE. What do you think? > Proba

Re: [Maria-developers] Accessing read records during join for condition pushdown

2021-07-08 Thread Sergei Golubchik
gt;table->record[0] is the current record for the table1, and f1->field->ptr is the pointer to the field1 value in that currect record > Thanks a lot for your help, > > Eduardo Berrocal García de Carellán > Senior Software Engineer > Intel Corporation | intel.com<

Re: [Maria-developers] b29ec61724d: MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra

2021-07-01 Thread Sergei Golubchik
ble_list->next_global) > { > - if (!table_list->is_view() && > + if (table_list->table && why do you check for table_list->table ? Can it happen that table_list->table == NULL and table_list->is_base_table() == true? > + table_list->is

<    1   2   3   4   5   6   7   8   9   10   >