1
0
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:
Michael Widenius
2014-03-19 15:15:57 +02:00
parent e7704bfdd6
commit 913d1f199c
5 changed files with 85 additions and 2 deletions

View File

@ -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)
{