diff options
| author | Michael Widenius <monty@mariadb.org> | 2014-07-30 22:01:10 +0300 |
|---|---|---|
| committer | Michael Widenius <monty@mariadb.org> | 2014-07-30 22:01:10 +0300 |
| commit | 14d00cd7f6291cb9b28e9f3ee273143da4aa4744 (patch) | |
| tree | 20d9061af89f8c9cf3b8c89d8732c7c5c57b9875 /sql/sql_parse.cc | |
| parent | 7019d450fd6b4b9659401e3ae71dc29d6e1dc996 (diff) | |
| download | mariadb-git-14d00cd7f6291cb9b28e9f3ee273143da4aa4744.tar.gz | |
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()
Diffstat (limited to 'sql/sql_parse.cc')
| -rw-r--r-- | sql/sql_parse.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d7fdb4d0473..da313be2d71 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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 */ |
