| 1 |
set @default_storage_engine= @@global.default_storage_engine; |
| 2 |
set global default_storage_engine=myisam; |
| 3 |
set session default_storage_engine=myisam; |
| 4 |
call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair it"); |
| 5 |
drop table if exists crashed,t2,t3,t4; |
| 6 |
SET @orig_debug=@@global.debug_dbug; |
| 7 |
CREATE TABLE crashed (c1 INT); |
| 8 |
CREATE TABLE t2 (c1 INT); |
| 9 |
CREATE TABLE t3 (c1 INT); |
| 10 |
CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(crashed,t2,t3) INSERT_METHOD=LAST; |
| 11 |
INSERT INTO crashed VALUES (10); |
| 12 |
INSERT INTO t2 VALUES (20); |
| 13 |
INSERT INTO t3 VALUES (30); |
| 14 |
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE; |
| 15 |
SET GLOBAL debug_dbug="+d,myisam_pretend_crashed_table_on_open"; |
| 16 |
CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29); |
| 17 |
SET GLOBAL debug_dbug=@orig_debug; |
| 18 |
INSERT INTO t4 VALUES (39); |
| 19 |
ERROR HY000: Table 'crashed' was not locked with LOCK TABLES |
| 20 |
INSERT INTO crashed VALUES (11); |
| 21 |
ERROR HY000: Table 'crashed' was not locked with LOCK TABLES |
| 22 |
INSERT INTO t2 VALUES (21); |
| 23 |
INSERT INTO t3 VALUES (31); |
| 24 |
UNLOCK TABLES; |
| 25 |
DROP TRIGGER t1_ai; |
| 26 |
DROP TABLE t4,crashed,t2,t3; |
| 27 |
set global default_storage_engine=@default_storage_engine; |