mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -179,6 +179,26 @@ sync_slave_with_master;
|
||||
--source include/show_binlog_events.inc
|
||||
connection master;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24351: S3, same-backend replication: Dropping a table on master
|
||||
--echo # causes error on slave
|
||||
--echo #
|
||||
show variables like 's3_replicate_alter_as_create_select';
|
||||
|
||||
connection slave;
|
||||
create table t3 (a int, b int) engine=aria;
|
||||
insert into t3 values (1,1),(2,2),(3,3);
|
||||
alter table t3 engine=s3;
|
||||
|
||||
connection master;
|
||||
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
drop table t3;
|
||||
--echo # Must show "DROP TABLE IF EXISTS t3", not just "DROP TABLE t3"
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
|
||||
--echo #
|
||||
--echo # clean up
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user