mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-5854 Interrupted CREATE OR REPLACE is written into binlog, and in a wrong format
mysql-test/r/create_or_replace2.result: Added test case mysql-test/t/create_or_replace.test: Fixed comment mysql-test/t/create_or_replace2.test: Added test case sql/sql_base.cc: Safety fix: Don't let threads with query_id=0 free temporary tables as this may free temporary tables not in use. This is mostly the case for the slave io threads, as most other threads has thd->query_id != 0. sql/sql_table.cc: Added comment. Ignore kill when opening temporary table for CREATE ... LIKE. This fixed the original isue
This commit is contained in:
@ -656,6 +656,12 @@ static void mark_temp_tables_as_free_for_reuse(THD *thd)
|
||||
{
|
||||
DBUG_ENTER("mark_temp_tables_as_free_for_reuse");
|
||||
|
||||
if (thd->query_id == 0)
|
||||
{
|
||||
/* Thread has not executed any statement and has not used any tmp tables */
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
thd->lock_temporary_tables();
|
||||
for (TABLE *table= thd->temporary_tables ; table ; table= table->next)
|
||||
{
|
||||
|
Reference in New Issue
Block a user