mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#51226: mysqlbinlog replay: ERROR 1146 when using temp tables
+ failing statements Implicit DROP event for temporary table is not getting LOG_EVENT_THREAD_SPECIFIC_F flag, because, in the previous executed statement in the same thread, which might even be a failed statement, the thread_specific_used flag is set to FALSE (in mysql_reset_thd_for_next_command) and not set to TRUE before connection is shutdown. This means that implicit DROP event will take the FALSE value from thread_specific_used and will not set LOG_EVENT_THREAD_SPECIFIC_F in the event header. As a consequence, mysqlbinlog will not print the pseudo_thread_id from the DROP event, because one of the requirements for the printout is that this flag is set to TRUE. We fix this by setting thread_specific_used whenever we are binlogging a DROP in close_temporary_tables, and resetting it to its previous value afterward.
This commit is contained in:
@@ -29,3 +29,14 @@ a
|
||||
6
|
||||
8
|
||||
drop table foo;
|
||||
RESET MASTER;
|
||||
create database b51226;
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
create temporary table t1(i int);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
insert into t1 values(1);
|
||||
DROP DATABASE b51226;
|
||||
FLUSH LOGS;
|
||||
|
Reference in New Issue
Block a user