mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
When using CREATE TEMPORARY TABLE LIKE to create a temporary table,
or using TRUNCATE to delete all rows of a temporary table, they
did not set the tmp_table_used flag, and cause the omission of
"SET @@session.pseudo_thread_id" when dumping binlog with mysqlbinlog,
and cause error when replay the statements.
This patch fixed the problem by setting tmp_table_used in these two
cases. (Done by He Zhenxing 2009-01-12)
mysql-test/suite/binlog/r/binlog_tmp_table.result:
Add test case for BUG#35583
mysql-test/suite/binlog/t/binlog_tmp_table.test:
Add test case for BUG#35583
sql/sql_delete.cc:
set thd->tmp_table_used when truncate temporary table
sql/sql_table.cc:
set thd->tmp_table_used when using create like to create temporary tables
This commit is contained in:
@@ -1010,6 +1010,9 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
share->db.str,
|
||||
share->table_name.str, 1))))
|
||||
(void) rm_temporary_table(table_type, path);
|
||||
else
|
||||
thd->thread_specific_used= TRUE;
|
||||
|
||||
free_table_share(share);
|
||||
my_free((char*) table,MYF(0));
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user