Commit 4291001d authored by unknown's avatar unknown

Fix for small bug #186 (If a connection has temporary tables and does

RESET MASTER, this breaks replication).
In the slave SQL thread, any DROP TEMPORARY TABLE is silently
converted to DROP TEMPORARY TABLE IF EXISTS, not to have irrelevant
"table does not exist". See comments in code or bug #186 for an example
of how irrelevant errors like this can arise.

parent 044b0b25
......@@ -2061,6 +2061,16 @@ mysql_execute_command(void)
{
if (check_table_access(thd,DROP_ACL,tables))
goto error; /* purecov: inspected */
/*
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_temporary)
lex->drop_if_exists= 1;
if (end_active_trans(thd))
res= -1;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment