diff options
Diffstat (limited to 'mysql-test/main/create_or_replace.test')
-rw-r--r-- | mysql-test/main/create_or_replace.test | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/mysql-test/main/create_or_replace.test b/mysql-test/main/create_or_replace.test index 3ae882139bc..1b4994e811f 100644 --- a/mysql-test/main/create_or_replace.test +++ b/mysql-test/main/create_or_replace.test @@ -210,7 +210,7 @@ drop table t1,t3,t4; create database mysqltest2; drop table if exists test.t1,mysqltest2.t2; -create table test.t1 (i int); +create table test.t1 (i int) engine=myisam; create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # @@ -249,6 +249,26 @@ create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a'; select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; + +create table test.t1 (i int) engine=innodb; +create table mysqltest2.t2 like test.t1; +lock table test.t1 write, mysqltest2.t2 write; +--replace_column 1 # +--sorted_result +select * from information_schema.metadata_lock_info; +unlock tables; +drop table test.t1,mysqltest2.t2; + +create table test.t1 (i int) engine=aria transactional=1 checksum=1; +create table mysqltest2.t2 like test.t1; +lock table test.t1 write, mysqltest2.t2 write; +--replace_column 1 # +--sorted_result +select * from information_schema.metadata_lock_info; +unlock tables; +drop table t1; + +create table test.t1 (i int); drop database mysqltest2; --echo # @@ -422,6 +442,27 @@ UNLOCK TABLES; DROP FUNCTION f1; DROP TABLE t1; + +--echo # +--echo # MDEV-14410 - Assertion `table->pos_in_locked_tables == __null || +--echo # table->pos_in_locked_tables->table == table' failed in +--echo # mark_used_tables_as_free_for_reuse +--echo # +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); + +CREATE TRIGGER tr1 BEFORE INSERT ON t3 FOR EACH ROW INSERT INTO t1 VALUES (); +CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t3 SELECT * FROM t1; + +LOCK TABLE t1 WRITE, t2 WRITE; +CREATE OR REPLACE TABLE t1 (i INT); +UNLOCK TABLES; +INSERT INTO t2 VALUES (1); + +# Cleanup +DROP TABLE t1, t2, t3; + --echo # --echo # MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in --echo # Locked_tables_list::unlock_locked_tables @@ -432,14 +473,14 @@ CREATE TABLE t3(a INT); LOCK TABLE t2 WRITE; SELECT * FROM t2; # drops t2 ---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE -CREATE OR REPLACE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; +--error ER_INVALID_DEFAULT +CREATE OR REPLACE TEMPORARY TABLE t1(c INT DEFAULT ''); # make sure we didn't leave locked tables mode --error ER_TABLE_NOT_LOCKED SELECT * FROM t3; # drops t1 ---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE -CREATE OR REPLACE TEMPORARY TABLE t2(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; +--error ER_INVALID_DEFAULT +CREATE OR REPLACE TEMPORARY TABLE t2(c INT DEFAULT ''); # make sure we didn't leave locked tables mode --error ER_TABLE_NOT_LOCKED SELECT * FROM t3; |