mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
fe03c7dce6
When a connection is dropped any remaining temporary table is also automatically dropped and the SQL statement of this operation is written to the binary log in order to drop such tables on the slave and keep the slave in sync. Specifically, the current code base creates the following type of statement: DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `db`.`table`; Unfortunately, appending the database to the table name in this manner circumvents the replicate-rewrite-db option (and any options that check the current database). To solve the issue, we started writing the statement to the binary as follows: use `db`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `table`;
24 lines
551 B
Text
24 lines
551 B
Text
source include/master-slave.inc;
|
|
--disable_warnings
|
|
create database if not exists mysqltest;
|
|
--enable_warnings
|
|
|
|
connect (con_temp,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
|
|
|
connection con_temp;
|
|
use mysqltest;
|
|
create temporary table mysqltest.t1 (n int);
|
|
create temporary table mysqltest.t2 (n int);
|
|
select get_lock("con_temp",10);
|
|
|
|
connection master;
|
|
disconnect con_temp;
|
|
select get_lock("con_temp",10);
|
|
sync_slave_with_master;
|
|
|
|
connection slave;
|
|
show status like 'Slave_open_temp_tables';
|
|
connection master;
|
|
drop database mysqltest;
|
|
|
|
# End of 4.1 tests
|