summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2019-05-02 14:07:24 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2019-05-02 14:07:24 +0300
commita5b711b3ab5502f4d79231dd8eab80f34ea454b8 (patch)
tree9796728682c00957b05f90b2b4d1a0a72aeefb76
parentca94ce2a5817cec6d402b6c92653330825e0a2bf (diff)
downloadmariadb-git-bb-10.1-MDEV-17883.tar.gz
MDEV-17883: CREATE TABLE IF NOT EXISTS locking changes in 10.3.10bb-10.1-MDEV-17883
Based on pull request https://github.com/MariaDB/server/pull/999 by mkaruza@galeracluster.com
-rw-r--r--sql/sql_base.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3a7ffdb656a..2399297dc37 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4389,10 +4389,10 @@ lock_table_names(THD *thd, const DDL_options_st &options,
mdl_requests.push_front(&global_request);
if (create_table)
- #ifdef WITH_WSREP
- if (thd->lex->sql_command != SQLCOM_CREATE_TABLE &&
- thd->wsrep_exec_mode != REPL_RECV)
- #endif
+#ifdef WITH_WSREP
+ if (!(thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
+ thd->wsrep_exec_mode == REPL_RECV))
+#endif
lock_wait_timeout= 0; // Don't wait for timeout
}
@@ -4403,6 +4403,7 @@ lock_table_names(THD *thd, const DDL_options_st &options,
bool res= thd->mdl_context.acquire_locks(&mdl_requests, lock_wait_timeout);
if (create_table)
thd->pop_internal_handler();
+
if (!res)
DBUG_RETURN(FALSE); // Got locks