| 1 |
# |
| 2 |
# Test failures with MERGE |
| 3 |
# |
| 4 |
|
| 5 |
--source include/have_debug.inc |
| 6 |
|
| 7 |
set @default_storage_engine= @@global.default_storage_engine; |
| 8 |
set global default_storage_engine=myisam; |
| 9 |
set session default_storage_engine=myisam; |
| 10 |
|
| 11 |
call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair it"); |
| 12 |
|
| 13 |
--disable_warnings |
| 14 |
drop table if exists crashed,t2,t3,t4; |
| 15 |
--enable_warnings |
| 16 |
|
| 17 |
SET @orig_debug=@@global.debug_dbug; |
| 18 |
|
| 19 |
# |
| 20 |
# Check that MariaDB handles reopen that fails without crashing |
| 21 |
# |
| 22 |
CREATE TABLE crashed (c1 INT); |
| 23 |
CREATE TABLE t2 (c1 INT); |
| 24 |
CREATE TABLE t3 (c1 INT); |
| 25 |
CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(crashed,t2,t3) INSERT_METHOD=LAST; |
| 26 |
INSERT INTO crashed VALUES (10); |
| 27 |
INSERT INTO t2 VALUES (20); |
| 28 |
INSERT INTO t3 VALUES (30); |
| 29 |
|
| 30 |
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE; |
| 31 |
SET GLOBAL debug_dbug="+d,myisam_pretend_crashed_table_on_open"; |
| 32 |
--disable_warnings |
| 33 |
CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29); |
| 34 |
--enable_warnings |
| 35 |
SET GLOBAL debug_dbug=@orig_debug; |
| 36 |
--error ER_TABLE_NOT_LOCKED |
| 37 |
INSERT INTO t4 VALUES (39); |
| 38 |
--error ER_TABLE_NOT_LOCKED |
| 39 |
INSERT INTO crashed VALUES (11); |
| 40 |
INSERT INTO t2 VALUES (21); |
| 41 |
INSERT INTO t3 VALUES (31); |
| 42 |
UNLOCK TABLES; |
| 43 |
DROP TRIGGER t1_ai; |
| 44 |
DROP TABLE t4,crashed,t2,t3; |
| 45 |
|
| 46 |
set global default_storage_engine=@default_storage_engine; |