Commit 5c49041b authored by Sergey Petrunya's avatar Sergey Petrunya

MDEV-4816: rpl.rpl_trunc_temp fails in 10.0-serg

Temorary fix for a number of replication tests (rpl.rpl_temp_table_mix_row 
rpl.rpl_trunc_temp rpl.rpl_current_user rpl.rpl_gtid_master_promote):

- THD::decide_logging_format() should not assume that mysql.gtid_slave_pos is 
  a non-replicated table. This used to cause unintended behavior for COMMIT 
  statement: replication would switch to row-based, etc.

The question of what should be done when a user issues a statement that
explicitly modifies mysql.gtid_slave_pos table remains open.
parent 0f985c64
...@@ -210,6 +210,7 @@ rpl_slave_state::truncate_state_table(THD *thd) ...@@ -210,6 +210,7 @@ rpl_slave_state::truncate_state_table(THD *thd)
{ {
table= tlist.table; table= tlist.table;
table->no_replicate= 1; table->no_replicate= 1;
table->s->is_gtid_slave_pos= TRUE; // TEMPORARY CODE
err= table->file->ha_truncate(); err= table->file->ha_truncate();
if (err) if (err)
...@@ -346,6 +347,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, ...@@ -346,6 +347,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
goto end; goto end;
table->no_replicate= 1; table->no_replicate= 1;
table->s->is_gtid_slave_pos= TRUE; // TEMPORARY CODE
if (!in_transaction) if (!in_transaction)
thd->variables.option_bits&= thd->variables.option_bits&=
~(ulonglong)(OPTION_NOT_AUTOCOMMIT|OPTION_BEGIN); ~(ulonglong)(OPTION_NOT_AUTOCOMMIT|OPTION_BEGIN);
......
...@@ -5001,7 +5001,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) ...@@ -5001,7 +5001,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx", DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx",
table->table_name, flags)); table->table_name, flags));
if (table->table->no_replicate) if (table->table->no_replicate && !table->table->s->is_gtid_slave_pos)
{ {
/* /*
The statement uses a table that is not replicated. The statement uses a table that is not replicated.
......
...@@ -315,6 +315,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, ...@@ -315,6 +315,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
strmov(share->path.str, path); strmov(share->path.str, path);
share->normalized_path.str= share->path.str; share->normalized_path.str= share->path.str;
share->normalized_path.length= path_length; share->normalized_path.length= path_length;
/* TEMPORARY FIX: if true, this means this is mysql.gtid_slave_pos table */
share->is_gtid_slave_pos= FALSE;
share->table_category= get_table_category(& share->db, & share->table_name); share->table_category= get_table_category(& share->db, & share->table_name);
share->set_refresh_version(); share->set_refresh_version();
share->open_errno= ENOENT; share->open_errno= ENOENT;
......
...@@ -644,6 +644,8 @@ struct TABLE_SHARE ...@@ -644,6 +644,8 @@ struct TABLE_SHARE
LEX_STRING normalized_path; /* unpack_filename(path) */ LEX_STRING normalized_path; /* unpack_filename(path) */
LEX_STRING connect_string; LEX_STRING connect_string;
bool is_gtid_slave_pos;
/* /*
Set of keys in use, implemented as a Bitmap. Set of keys in use, implemented as a Bitmap.
Excludes keys disabled by ALTER TABLE ... DISABLE KEYS. Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment