1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE

In statement-based or mixed-mode replication, use DROP TEMPORARY TABLE
to drop multiple tables causes different errors on master and slave, 
when one or more of these tables do not exist. Because when executed
on slave, it would automatically add IF EXISTS to the query to ignore
all ER_BAD_TABLE_ERROR errors.

To fix the problem, do not add IF EXISTS when executing DROP TEMPORARY
TABLE on the slave, and clear the ER_BAD_TABLE_ERROR error after
execution if the query does not expect any errors.
This commit is contained in:
2009-12-31 11:33:10 +08:00
parent 6c16fb6d4e
commit ccc3a46856
4 changed files with 58 additions and 12 deletions

View File

@ -4038,17 +4038,6 @@ end_with_restore_list:
}
else
{
/*
If this is a slave thread, we may sometimes execute some
DROP / * 40005 TEMPORARY * / TABLE
that come from parts of binlogs (likely if we use RESET SLAVE or CHANGE
MASTER TO), while the temporary table has already been dropped.
To not generate such irrelevant "table does not exist errors",
we silently add IF EXISTS if TEMPORARY was used.
*/
if (thd->slave_thread)
lex->drop_if_exists= 1;
/* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */
thd->transaction.all.modified_non_trans_table= TRUE;
}