1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

The automatic DROP TEMPORARY TABLE is now DROP TEMPORARY TABLE IF EXISTS,

this is better in this case:
- imagine user1 has created a temp table
- imagine user2 does FLUSH TABLES WITH READ LOCK, then takes a backup,
then RESET MASTER then UNLOCK TABLES, like mysqldump --first-slave
- then in the binlog you will finally have the DROP TEMPORARY TABLE,
but not the CREATE TEMPORARY TABLE, so when you later restore with
mysqlbinlog|mysql, mysql will complain that table does not exist.
Replication was already protected of this (it processes DROP TEMPORARY
TABLE as if there was a IF EXISTS), now I add it directly to the query
for mysqlbinlog|mysql to work.


mysql-test/r/drop_temp_table.result:
  result update (query changed)
This commit is contained in:
unknown
2004-03-20 15:49:17 +01:00
parent 8b623739ef
commit 02d2d70cb1
2 changed files with 5 additions and 4 deletions

View File

@ -547,7 +547,7 @@ void close_temporary_tables(THD *thd)
return;
LINT_INIT(end);
query_buf_size= 50; // Enough for DROP ... TABLE
query_buf_size= 50; // Enough for DROP ... TABLE IF EXISTS
for (table=thd->temporary_tables ; table ; table=table->next)
/*
@ -558,7 +558,8 @@ void close_temporary_tables(THD *thd)
query_buf_size+= table->key_length+1;
if ((query = alloc_root(&thd->mem_root, query_buf_size)))
end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE ");
// Better add "if exists", in case a RESET MASTER has been done
end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ");
for (table=thd->temporary_tables ; table ; table=next)
{