1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.9' into 10.10

This commit is contained in:
Oleksandr Byelkin
2023-08-05 16:14:46 +02:00
867 changed files with 12543 additions and 6345 deletions

View File

@ -1866,6 +1866,13 @@ Sys_gtid_domain_id(
ON_CHECK(check_gtid_domain_id));
/*
Check that setting gtid_seq_no isn't done inside a transaction, and (in
gtid_strict_mode) doesn't create an out-of-order GTID sequence.
Setting gtid_seq_no to DEFAULT or 0 means we 'reset' it so that the value
doesn't affect the GTID of the next event group written to the binlog.
*/
static bool check_gtid_seq_no(sys_var *self, THD *thd, set_var *var)
{
uint32 domain_id, server_id;
@ -1876,13 +1883,16 @@ static bool check_gtid_seq_no(sys_var *self, THD *thd, set_var *var)
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO)))
return true;
domain_id= thd->variables.gtid_domain_id;
server_id= thd->variables.server_id;
seq_no= (uint64)var->value->val_uint();
DBUG_EXECUTE_IF("ignore_set_gtid_seq_no_check", return 0;);
if (opt_gtid_strict_mode && opt_bin_log &&
mysql_bin_log.check_strict_gtid_sequence(domain_id, server_id, seq_no))
return true;
DBUG_EXECUTE_IF("ignore_set_gtid_seq_no_check", return false;);
if (var->value && opt_gtid_strict_mode && opt_bin_log)
{
domain_id= thd->variables.gtid_domain_id;
server_id= thd->variables.server_id;
seq_no= (uint64)var->value->val_uint();
if (seq_no != 0 &&
mysql_bin_log.check_strict_gtid_sequence(domain_id, server_id, seq_no))
return true;
}
return false;
}