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

MDEV-24351: S3, same-backend replication: Dropping a table on master...

..causes error on slave.
Cause: if the master doesn't have the frm file for the table,
DROP TABLE code will call ha_delete_table_force() to drop the table
in all available storage engines.
The issue was that this code path didn't check for
HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE flag for the storage engine,
and so did not add "... IF EXISTS" to the statement that's written
to the binary log.  This can cause error on the slave when it tries to
drop a table that's already gone.
This commit is contained in:
Sergei Petrunia
2020-12-08 16:51:14 +03:00
parent 3ee24b2306
commit 6859e80df7
5 changed files with 73 additions and 4 deletions

View File

@ -5020,6 +5020,8 @@ static my_bool delete_table_force(THD *thd, plugin_ref plugin, void *arg)
param->error= error;
if (error == 0)
{
if (hton && hton->flags & HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE)
thd->replication_flags |= OPTION_IF_EXISTS;
param->error= 0;
return TRUE; // Table was deleted
}