mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#19188: incorrect temporary table name of DROP query in replication
A pattern to generate binlog for DROPped temp table in close_temporary_tables was buggy: could not deal with a grave-accent-in-name table. The fix exploits `append_identifier()' for quoting and duplicating accents. mysql-test/r/rpl_temporary.result: results changed mysql-test/t/rpl_temporary.test: more correct internal table emulation; typo of @@session in bug#17263. sql/mysql_priv.h: bool is_user_table(TABLE * table) is added to answer wheather temporary table was created explicitly. sql/sql_base.cc: Utilizing `append_identifier' to quote. `close_temporary_tables' once again recoded I hope to become much simplier than previously. No-binlog branch is separated completely the rest that adopts String's methods.
This commit is contained in:
@ -89,14 +89,17 @@ f
|
||||
7
|
||||
drop table t1,t2;
|
||||
create temporary table t3 (f int);
|
||||
set @session.pseudo_thread_id=100;
|
||||
set @@session.pseudo_thread_id=100;
|
||||
create temporary table t101 (id int);
|
||||
create temporary table t102 (id int);
|
||||
set @session.pseudo_thread_id=200;
|
||||
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 temporary table `t``201` (id int);
|
||||
create temporary table `#sql_not_user_table202` (id int);
|
||||
set @@session.pseudo_thread_id=300;
|
||||
create temporary table t301 (id int);
|
||||
create temporary table t302 (id int);
|
||||
create temporary table `#sql_not_user_table303` (id int);
|
||||
create table t1(f int);
|
||||
insert into t1 values (1);
|
||||
select * from t1 /* must be 1 */;
|
||||
|
@ -135,14 +135,19 @@ sync_with_master;
|
||||
# value was set up at the moment of temp table creation
|
||||
#
|
||||
connection con1;
|
||||
set @session.pseudo_thread_id=100;
|
||||
set @@session.pseudo_thread_id=100;
|
||||
create temporary table t101 (id int);
|
||||
create temporary table t102 (id int);
|
||||
set @session.pseudo_thread_id=200;
|
||||
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 temporary table `t``201` (id int);
|
||||
# emulate internal temp table not to come to binlog
|
||||
create temporary table `#sql_not_user_table202` (id int);
|
||||
set @@session.pseudo_thread_id=300;
|
||||
create temporary table t301 (id int);
|
||||
create temporary table t302 (id int);
|
||||
create temporary table `#sql_not_user_table303` (id int);
|
||||
disconnect con1;
|
||||
|
||||
#now do something to show that slave is ok after DROP temp tables
|
||||
connection master;
|
||||
|
Reference in New Issue
Block a user