summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-10-19 11:06:32 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-10-26 14:33:07 +0200
commit6211c35549338c07b766a3671dc0714140a26915 (patch)
tree610829c5fa983f6f6cb5f561f8d25a0f167260b7 /mysql-test/t
parent81b8547697f16215be52f4cc2515bcad8c142eaa (diff)
downloadmariadb-git-6211c35549338c07b766a3671dc0714140a26915.tar.gz
MDEV-23391 Crash/assertion CREATE OR REPLACE TABLE AS SELECT under LOCK TABLE
Happens with Innodb engine. Move unlock_locked_table() past drop_open_table(), and rollback current statement, so that we can actually unlock the table. Anything else results in assertions, in drop, or unlock, or in close_table.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/create_or_replace.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test
index 4b167663742..ba32f4b7603 100644
--- a/mysql-test/t/create_or_replace.test
+++ b/mysql-test/t/create_or_replace.test
@@ -251,6 +251,25 @@ create table t1 (i int);
drop table t1;
drop database mysqltest2;
+
+--echo #
+--echo # MDEV-23391 Server crash in close_thread_table or assertion, upon CREATE OR REPLACE TABLE under lock
+--echo #
+create table t1 (i int);
+lock table t1 write;
+--replace_column 1 #
+--sorted_result
+select * from information_schema.metadata_lock_info;
+--error ER_DATA_TOO_LONG
+create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a;
+show tables;
+--replace_column 1 #
+--sorted_result
+select * from information_schema.metadata_lock_info;
+create table t1 (i int);
+drop table t1;
+
+
--echo #
--echo # Testing CREATE .. LIKE
--echo #