mariadb/mysql-test/main/merge_debug.test
Sergei Petrunia e709eb9bf7 Merge branch '10.2' into 10.3
# Conflicts:
#	mysql-test/suite/galera/r/MW-388.result
#	mysql-test/suite/galera/t/MW-388.test
#	mysql-test/suite/innodb/r/truncate_inject.result
#	mysql-test/suite/innodb/t/truncate_inject.test
#	mysql-test/suite/rpl/r/rpl_stop_slave.result
#	mysql-test/suite/rpl/t/rpl_stop_slave.test
#	sql/sp_head.cc
#	sql/sp_head.h
#	sql/sql_lex.cc
#	sql/sql_yacc.yy
#	storage/xtradb/buf/buf0dblwr.cc
2020-01-17 00:46:40 +03:00

46 lines
1.3 KiB
Text

#
# Test failures with MERGE
#
--source include/have_debug.inc
set @default_storage_engine= @@global.storage_engine;
set global storage_engine=myisam;
set session storage_engine=myisam;
call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair it");
--disable_warnings
drop table if exists crashed,t2,t3,t4;
--enable_warnings
SET @orig_debug=@@global.debug_dbug;
#
# Check that MariaDB handles reopen that fails without crashing
#
CREATE TABLE crashed (c1 INT);
CREATE TABLE t2 (c1 INT);
CREATE TABLE t3 (c1 INT);
CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(crashed,t2,t3) INSERT_METHOD=LAST;
INSERT INTO crashed VALUES (10);
INSERT INTO t2 VALUES (20);
INSERT INTO t3 VALUES (30);
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE;
SET GLOBAL debug_dbug="+d,myisam_pretend_crashed_table_on_open";
--disable_warnings
CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29);
--enable_warnings
SET GLOBAL debug_dbug=@orig_debug;
--error ER_TABLE_NOT_LOCKED
INSERT INTO t4 VALUES (39);
--error ER_TABLE_NOT_LOCKED
INSERT INTO crashed VALUES (11);
INSERT INTO t2 VALUES (21);
INSERT INTO t3 VALUES (31);
UNLOCK TABLES;
DROP TRIGGER t1_ai;
DROP TABLE t4,crashed,t2,t3;
set global storage_engine=@default_storage_engine;