Skip to content

Commit

Permalink
MDEV-17883: CREATE TABLE IF NOT EXISTS locking changes in 10.3.10
Browse files Browse the repository at this point in the history
Based on pull request #999
by mkaruza@galeracluster.com
  • Loading branch information
Jan Lindström committed May 3, 2019
1 parent b85aa20 commit 15f0655
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sql/sql_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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

Expand Down

0 comments on commit 15f0655

Please sign in to comment.