Commit f16d4d4c authored by Sachin's avatar Sachin

MDEV-17720 slave_ddl_exec_mode=IDEMPOTENT does not handle DROP DATABASE

Relevant if exists flag are added for create database and drop database.
parent 7e606a2d
......@@ -67,6 +67,18 @@ a
-3
1
include/check_slave_no_error.inc
drop table t1, t2;
DROP TABLE t1, t2;
include/check_slave_no_error.inc
create database d;
create database e;
create database d;
create database if not exists e;
include/check_slave_no_error.inc
drop database d;
drop database e;
drop database d;
drop database if exists e;
include/check_slave_no_error.inc
SET @@global.slave_exec_mode= @old_slave_exec_mode;
include/rpl_end.inc
......@@ -75,9 +75,30 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
--source include/check_slave_no_error.inc
connection slave;
drop table t1, t2;
connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
--source include/check_slave_no_error.inc
create database d;
create database e;
connection master;
create database d;
create database if not exists e;
sync_slave_with_master;
--source include/check_slave_no_error.inc
drop database d;
drop database e;
connection master;
drop database d;
drop database if exists e;
sync_slave_with_master;
--source include/check_slave_no_error.inc
SET @@global.slave_exec_mode= @old_slave_exec_mode;
......
......@@ -3884,6 +3884,9 @@ case SQLCOM_PREPARE:
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
break;
}
if (slave_ddl_exec_mode_options == SLAVE_EXEC_MODE_IDEMPOTENT &&
!(lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS))
create_info.options|= HA_LEX_CREATE_IF_NOT_EXISTS;
}
#endif
if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0))
......@@ -3915,6 +3918,9 @@ case SQLCOM_PREPARE:
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
break;
}
if (!thd->slave_expected_error &&
slave_ddl_exec_mode_options == SLAVE_EXEC_MODE_IDEMPOTENT)
lex->check_exists= 1;
}
#endif
if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0))
......
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