mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN WITH TEMPORARY TABLE -> ERRORS
Analysis ======== Point in time recovery using mysqlbinlog containing queries operating on temporary tables results in an error. While writing the query log event in the binary log, the thread id used for execution of DROP TABLE and DELETE commands were incorrect. The thread variable 'thread_specific_used' is used to determine whether a specific thread id is to used while executing the statements i.e using 'SET @@session.pseudo_thread_id'. This variable was not set correctly for DROP TABLE query and was never set for DELETE query. The thread id is important for temporary tables since the tables are session specific. DROP TABLE and DELETE queries executed using a wrong thread id resulted in errors while applying the queries generated by mysqlbinlog utility. Fix === Set the 'thread_specific_used' THD variable for DROP TABLE and DELETE queries. ReviewBoard: 21833
This commit is contained in:
committed by
Sergei Golubchik
parent
7473a71a28
commit
2536c0b1eb
@@ -63,3 +63,30 @@ master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
|
||||
RESET MASTER;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN
|
||||
# WITH TEMPORARY TABLE -> ERRORS
|
||||
# Test case for DELETE query.
|
||||
RESET MASTER;
|
||||
# Set up.
|
||||
SET @save_binlog_format= @@session.binlog_format;
|
||||
SET @@session.binlog_format=STATEMENT;
|
||||
CREATE TABLE t1 (a INT) ENGINE=INNODB;
|
||||
SET @@session.binlog_format=STATEMENT;
|
||||
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
|
||||
DELETE d1, d2 FROM t1 AS d1, t1 AS d2 WHERE d1.a<>d2.a;
|
||||
DROP TABLE t1;
|
||||
# DELETE query fails with table re-open error without patch.
|
||||
# Clean up.
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
RESET MASTER;
|
||||
# Test case for DROP query.
|
||||
CREATE TABLE t1 (a INT) ENGINE=INNODB;
|
||||
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
# DROP table query fails with unknown table error without patch.
|
||||
# Clean up
|
||||
SET @@session.binlog_format= @save_binlog_format;
|
||||
RESET MASTER;
|
||||
|
Reference in New Issue
Block a user