summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.cc
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2018-05-08 22:17:18 +0300
committerAndrei Elkin <andrei.elkin@mariadb.com>2018-05-18 16:48:39 +0300
commit9df656db65e983b7003af5438a05def97d916c19 (patch)
tree0407523469119fe96b9bdeef2ac4f11a543b9e4a /sql/rpl_rli.cc
parent2a33d248e0bd910ec10a2bb68e47f17b47e3a980 (diff)
downloadmariadb-git-9df656db65e983b7003af5438a05def97d916c19.tar.gz
MDEV-15373 engine gtid_slave_pos table name disobeys lower-case-table-names
Replicated transaction extra gtid statement on slave failed to specify an engine gtid_slave_pos name correctly. In case lower-case-table-names > 0 the InnoDB table name was generated to reproduce the lower-case-table-names=0 version which is of mixed cases. In rpl.rpl_mdev12179 test run this triggered a failure to DROP table which was due to the innodb table handle was not closed: InnoDB: Waited XYZ seconds for ref-count on table: `mysql`.`gtid_slave_pos_innodb` on windows. The closing issue was caused by having the table registered twice in the table cache, for its lower- and mixed- case name versions. The DROP-table handler closed only only one of the cache item to leave the 2nd one active. (On Linux a failure occurs earlier at attempt to open an expected lower-cased table: Last_Error: Error during XID COMMIT: failed to update GTID state in mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos_InnoDB' doesn't exist but the table's name as the message shows is not in the right case). Fixed with consulting lower-case-table-names when the engine gtid-slave-pos table is created. Note the lower-case-table-names=a-value created table will not recognized when next the lower case option changes to a different value. In 10.4 a follow-up patch is going to lowercase gtid-slave-pos autocreated table at once at their origination, and a warning is issued in the 10.3 current patch.
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r--sql/rpl_rli.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 70b5832b274..05dffe2c462 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1780,6 +1780,7 @@ gtid_pos_auto_create_tables(rpl_slave_state::gtid_pos_table **list_ptr)
p= strmake(p, plugin_name(*auto_engines)->str, FN_REFLEN - (p - buf));
table_name.str= buf;
table_name.length= p - buf;
+ table_case_convert(const_cast<char*>(table_name.str), table_name.length);
entry= rpl_global_gtid_slave_state->alloc_gtid_pos_table
(&table_name, hton, rpl_slave_state::GTID_POS_AUTO_CREATE);
if (!entry)