summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/merge/merge_debug.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
commita2a2e32c02643a0cec111511220227703fda1cd5 (patch)
tree69cc2b631234c2a8e026b9cd4d72676c61c594df /mysql-test/suite/merge/merge_debug.test
parentReleasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff)
downloadmariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz
mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/merge/merge_debug.test')
-rw-r--r--mysql-test/suite/merge/merge_debug.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/suite/merge/merge_debug.test b/mysql-test/suite/merge/merge_debug.test
new file mode 100644
index 00000000..4141042c
--- /dev/null
+++ b/mysql-test/suite/merge/merge_debug.test
@@ -0,0 +1,46 @@
+#
+# Test failures with MERGE
+#
+
+--source include/have_debug.inc
+
+set @default_storage_engine= @@global.default_storage_engine;
+set global default_storage_engine=myisam;
+set session default_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 default_storage_engine=@default_storage_engine;