diff options
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r-- | mysql-test/t/create.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index d80127df860..c472c9f0a05 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1996,4 +1996,25 @@ create table if not exists t1 (a int unique, b int) ignore select 1 as a, 1 as b union select 1 as a, 2 as b; select * from t1; drop table t1; + +--echo # +--echo # Checking that CREATE IF NOT EXISTS is not blocked by running SELECT --echo # + +create table t1 (a int, b int) engine=myisam; +create table t2 (a int, b int) engine=myisam; +insert into t1 values (1,1); +lock tables t1 read; +connect (user1,localhost,root,,test); +set @@lock_wait_timeout=5; +--error ER_TABLE_EXISTS_ERROR +create table if not exists t1 (a int, b int); +--error ER_TABLE_EXISTS_ERROR +create table if not exists t1 (a int, b int) select 2,2; +--error ER_TABLE_EXISTS_ERROR +create table if not exists t1 like t2; +disconnect user1; +connection default; +select * from t1; +unlock tables; +drop table t1,t2; |