Commit 0fcb141f authored by Sergey Vojtovich's avatar Sergey Vojtovich

Fixed main.create-big failure

After MDEV-17772 table existence check is performed much earlier, so
create_table_select_before_check_if_exists debug sync point is not
reachable when table exists.

Moved debug sync point to appropriate place.
parent 80491609
...@@ -237,11 +237,11 @@ select @a; ...@@ -237,11 +237,11 @@ select @a;
@a @a
0 0
drop table t1; drop table t1;
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; set debug_sync='create_table_before_check_if_exists SIGNAL parked WAIT_FOR go';
create table if not exists t1 select 1 as i;; create table if not exists t1 select 1 as i;
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
drop table t1;; drop table t1;
connection addconroot2; connection addconroot2;
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
connection default; connection default;
...@@ -249,11 +249,11 @@ connection addconroot1; ...@@ -249,11 +249,11 @@ connection addconroot1;
connection default; connection default;
create table t1 (i int); create table t1 (i int);
set @a:=0; set @a:=0;
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; set debug_sync='create_table_before_check_if_exists SIGNAL parked WAIT_FOR go';
create table if not exists t1 select 1 as i;; create table if not exists t1 select 1 as i;
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
create trigger t1_bi before insert on t1 for each row set @a:=1;; create trigger t1_bi before insert on t1 for each row set @a:=1;
connection addconroot2; connection addconroot2;
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
connection default; connection default;
......
...@@ -395,11 +395,11 @@ select @a; ...@@ -395,11 +395,11 @@ select @a;
drop table t1; drop table t1;
# Concurrent DROP TABLE # Concurrent DROP TABLE
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; set debug_sync='create_table_before_check_if_exists SIGNAL parked WAIT_FOR go';
--send create table if not exists t1 select 1 as i; --send create table if not exists t1 select 1 as i
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
--send drop table t1; --send drop table t1
connection addconroot2; connection addconroot2;
# Wait until the above DROP TABLE is blocked due to CREATE TABLE # Wait until the above DROP TABLE is blocked due to CREATE TABLE
let $wait_condition= let $wait_condition=
...@@ -417,11 +417,11 @@ connection default; ...@@ -417,11 +417,11 @@ connection default;
# Concurrent CREATE TRIGGER # Concurrent CREATE TRIGGER
create table t1 (i int); create table t1 (i int);
set @a:=0; set @a:=0;
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; set debug_sync='create_table_before_check_if_exists SIGNAL parked WAIT_FOR go';
--send create table if not exists t1 select 1 as i; --send create table if not exists t1 select 1 as i
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
--send create trigger t1_bi before insert on t1 for each row set @a:=1; --send create trigger t1_bi before insert on t1 for each row set @a:=1
connection addconroot2; connection addconroot2;
# Wait until the above DROP TABLE is blocked due to CREATE TABLE # Wait until the above DROP TABLE is blocked due to CREATE TABLE
let $wait_condition= let $wait_condition=
......
...@@ -3893,6 +3893,7 @@ static bool upgrade_lock_if_not_exists(THD *thd, ...@@ -3893,6 +3893,7 @@ static bool upgrade_lock_if_not_exists(THD *thd,
if (thd->lex->sql_command == SQLCOM_CREATE_TABLE || if (thd->lex->sql_command == SQLCOM_CREATE_TABLE ||
thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE)
{ {
DEBUG_SYNC(thd,"create_table_before_check_if_exists");
if (!create_info.or_replace() && if (!create_info.or_replace() &&
ha_table_exists(thd, &create_table->db, &create_table->table_name)) ha_table_exists(thd, &create_table->db, &create_table->table_name))
{ {
......
...@@ -4420,8 +4420,6 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u) ...@@ -4420,8 +4420,6 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u)
thd->binlog_start_trans_and_stmt(); thd->binlog_start_trans_and_stmt();
} }
DEBUG_SYNC(thd,"create_table_select_before_check_if_exists");
if (!(table= create_table_from_items(thd, &values, &extra_lock, hook_ptr))) if (!(table= create_table_from_items(thd, &values, &extra_lock, hook_ptr)))
/* abort() deletes table */ /* abort() deletes table */
DBUG_RETURN(-1); DBUG_RETURN(-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment