summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 5f826e37a76..55c51dbe151 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -764,8 +764,7 @@ exit:
}
-int mysql_create_db(THD *thd, const LEX_CSTRING *db,
- const DDL_options_st &options,
+int mysql_create_db(THD *thd, const LEX_CSTRING *db, DDL_options_st options,
const Schema_specification_st *create_info)
{
/*
@@ -773,6 +772,9 @@ int mysql_create_db(THD *thd, const LEX_CSTRING *db,
to it, we need to use a copy to make execution prepared statement- safe.
*/
Schema_specification_st tmp(*create_info);
+ if (thd->slave_thread &&
+ slave_ddl_exec_mode_options == SLAVE_EXEC_MODE_IDEMPOTENT)
+ options.add(DDL_options::OPT_IF_NOT_EXISTS);
return mysql_create_db_internal(thd, db, options, &tmp, false);
}
@@ -1047,6 +1049,9 @@ exit:
bool mysql_rm_db(THD *thd, const LEX_CSTRING *db, bool if_exists)
{
+ if (thd->slave_thread &&
+ slave_ddl_exec_mode_options == SLAVE_EXEC_MODE_IDEMPOTENT)
+ if_exists= true;
return mysql_rm_db_internal(thd, db, if_exists, false);
}