1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed MDEV-6451: "Error 'Table 't1' already exists' on query" with slave_ddl_exec_mode=IDEMPOTENT

There was a race condition in lock_table_names() which didn't properly test for CREATE OR REPLACE for slaves.


sql/sql_parse.cc:
  Copy create_info flags to thd for lock_table_names()
sql/sql_table.cc:
  Copy create_info flags to thd for lock_table_names()
This commit is contained in:
Michael Widenius
2014-07-30 22:01:10 +03:00
parent 7019d450fd
commit 14d00cd7f6
2 changed files with 22 additions and 3 deletions

View File

@ -2945,7 +2945,11 @@ case SQLCOM_PREPARE:
goto end_with_restore_list;
}
/* Copy temporarily the statement flags to thd for lock_table_names() */
uint save_thd_create_info_options= thd->lex->create_info.options;
thd->lex->create_info.options|= create_info.options;
res= open_and_lock_tables(thd, lex->query_tables, TRUE, 0);
thd->lex->create_info.options= save_thd_create_info_options;
if (res)
{
/* Got error or warning. Set res to 1 if error */