mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
1) undoing my fix for BUG#8055 "Trouble with replication from temporary tables and ignores"
and fixing it another way (per Monty; a simpler solution which does not increase the number of binlog events is to always execute DROP TEMPORARY TABLE IF EXISTS on slave). A new test rpl_drop_temp. 2) fixing BUG#8436 "Multiple "stacked" SQL statements cause replication to stop" by setting thd->query_length to the length of the query being executed, not counting the next queries if this is a multi-query. Should also improve display of SHOW PROCESSLIST. A new test rpl_multi_query. mysql-test/r/drop_temp_table.result: back to one single DROP sql/sql_base.cc: undoing the fix I had made some days ago: we are back to one single DROP TEMPORARY TABLE for all temp tables. sql/sql_parse.cc: 1) set thd->query_length to the length of the query being executed, excluding the other next queries if this is a multi-query. The setting happens ASAP, ie. just after we know it's a multi-query, ie. just after yyparse(). Don't include the ';' in thd->query_length, because this is not good for storage in binlog. 2) always execute a DROP TEMPORARY TABLE IF EXISTS on slave, don't skip it even if --replicate-ignore-table
This commit is contained in:
2
mysql-test/t/rpl_drop_temp-slave.opt
Normal file
2
mysql-test/t/rpl_drop_temp-slave.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--replicate-ignore-table=mysqltest.t2
|
||||
|
13
mysql-test/t/rpl_drop_temp.test
Normal file
13
mysql-test/t/rpl_drop_temp.test
Normal file
@ -0,0 +1,13 @@
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
create database if not exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create temporary table mysqltest.t1 (n int);
|
||||
create temporary table mysqltest.t2 (n int);
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
disconnect master;
|
||||
connection slave;
|
||||
--real_sleep 3; # time for DROP to be written
|
||||
show status like 'Slave_open_temp_tables';
|
26
mysql-test/t/rpl_multi_query.test
Normal file
26
mysql-test/t/rpl_multi_query.test
Normal file
@ -0,0 +1,26 @@
|
||||
# Test for BUG#8436: verify that a multi-query (i.e. one query
|
||||
# containing several queries (assuming client has
|
||||
# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
|
||||
# one binlog event containing all queries)
|
||||
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
create database mysqltest;
|
||||
|
||||
delimiter /;
|
||||
create table mysqltest.t1 ( n int);
|
||||
insert into mysqltest.t1 values(1)/
|
||||
insert into mysqltest.t1 values(2);
|
||||
insert into mysqltest.t1 values(3);
|
||||
insert into mysqltest.t1 values(4);
|
||||
insert into mysqltest.t1 values(5)/
|
||||
delimiter ;/
|
||||
sync_slave_with_master;
|
||||
select * from mysqltest.t1;
|
||||
connection master;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 79;
|
||||
drop database mysqltest;
|
||||
sync_slave_with_master;
|
Reference in New Issue
Block a user