mirror of
https://github.com/MariaDB/server.git
synced 2025-06-12 01:53:02 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user