mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#17263 temporary tables and replication
Backporting a changeset made for 5.0. Comments from there: The fix refines the algorithm of generating DROPs for binlog. Temp tables with common pseudo_thread_id are clustered into one query. Consequently one replication event per pseudo_thread_id is generated. mysql-test/r/rpl_temporary.result: results changed mysql-test/t/rpl_temporary.test: test to generate problematic drop in binlog to feed it to restarting slave to see no stop. sql/sql_base.cc: change in drop temprorary tables alg in close_temporary_tables.
This commit is contained in:
@ -89,3 +89,17 @@ f
|
||||
7
|
||||
drop table t1,t2;
|
||||
create temporary table t3 (f int);
|
||||
set @session.pseudo_thread_id=100;
|
||||
create temporary table t101 (id int);
|
||||
create temporary table t102 (id int);
|
||||
set @session.pseudo_thread_id=200;
|
||||
create temporary table t201 (id int);
|
||||
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int);
|
||||
set @con1_id=connection_id();
|
||||
kill @con1_id;
|
||||
create table t1(f int);
|
||||
insert into t1 values (1);
|
||||
select * from t1 /* must be 1 */;
|
||||
f
|
||||
1
|
||||
drop table t1;
|
||||
|
@ -128,6 +128,32 @@ drop table t1,t2;
|
||||
create temporary table t3 (f int);
|
||||
sync_with_master;
|
||||
|
||||
# The server will now close done
|
||||
#
|
||||
# BUG#17263 incorrect generation DROP temp tables
|
||||
# Temporary tables of connection are dropped in batches
|
||||
# where a batch correspond to pseudo_thread_id
|
||||
# value was set up at the moment of temp table creation
|
||||
#
|
||||
connection con1;
|
||||
set @session.pseudo_thread_id=100;
|
||||
create temporary table t101 (id int);
|
||||
create temporary table t102 (id int);
|
||||
set @session.pseudo_thread_id=200;
|
||||
create temporary table t201 (id int);
|
||||
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int);
|
||||
set @con1_id=connection_id();
|
||||
kill @con1_id;
|
||||
|
||||
#now do something to show that slave is ok after DROP temp tables
|
||||
connection master;
|
||||
create table t1(f int);
|
||||
insert into t1 values (1);
|
||||
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
select * from t1 /* must be 1 */;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user