mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-17720 slave_ddl_exec_mode=IDEMPOTENT does not handle DROP DATABASE
Relevant if exists flag are added for create database and drop database.
This commit is contained in:
@ -67,6 +67,18 @@ a
|
|||||||
-3
|
-3
|
||||||
1
|
1
|
||||||
include/check_slave_no_error.inc
|
include/check_slave_no_error.inc
|
||||||
|
drop table t1, t2;
|
||||||
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;
|
SET @@global.slave_exec_mode= @old_slave_exec_mode;
|
||||||
include/rpl_end.inc
|
include/rpl_end.inc
|
||||||
|
@ -75,9 +75,30 @@ SELECT * FROM t1 ORDER BY a;
|
|||||||
SELECT * FROM t2 ORDER BY a;
|
SELECT * FROM t2 ORDER BY a;
|
||||||
--source include/check_slave_no_error.inc
|
--source include/check_slave_no_error.inc
|
||||||
|
|
||||||
|
connection slave;
|
||||||
|
drop table t1, t2;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
sync_slave_with_master;
|
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;
|
SET @@global.slave_exec_mode= @old_slave_exec_mode;
|
||||||
|
|
||||||
|
@ -3884,6 +3884,9 @@ end_with_restore_list:
|
|||||||
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
||||||
break;
|
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
|
#endif
|
||||||
if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0))
|
if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0))
|
||||||
@ -3915,6 +3918,9 @@ end_with_restore_list:
|
|||||||
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!thd->slave_expected_error &&
|
||||||
|
slave_ddl_exec_mode_options == SLAVE_EXEC_MODE_IDEMPOTENT)
|
||||||
|
lex->check_exists= 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0))
|
if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0))
|
||||||
|
Reference in New Issue
Block a user