Skip to content
Permalink
Browse files
MDEV-17720 slave_ddl_exec_mode=IDEMPOTENT does not handle DROP DATABASE
Relevant if exists flag are added for create database and drop database.
  • Loading branch information
mariadb-SachinSetiya committed Dec 19, 2018
1 parent 7e606a2 commit f16d4d4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
@@ -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))

0 comments on commit f16d4d4

Please sign in to comment.