summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/instant_alter_debug.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/t/instant_alter_debug.test')
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test63
1 files changed, 51 insertions, 12 deletions
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index 69aab6e2fc1..9d85d281361 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -1,7 +1,7 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
---source include/have_innodb.inc
+
SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
@@ -38,18 +38,9 @@ SELECT * FROM t3;
CREATE TABLE t4 (pk INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t4 VALUES (0);
ALTER TABLE t4 ADD COLUMN b INT;
-SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
+SELECT COUNT(*)>0 FROM INFORMATION_SCHEMA.COLUMNS
LEFT JOIN t4 ON (NUMERIC_SCALE = pk);
-SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL enter WAIT_FOR delete';
---send
ALTER TABLE t4 ADD COLUMN c INT;
-connect (dml,localhost,root,,);
-SET DEBUG_SYNC='now WAIT_FOR enter';
-DELETE FROM t4;
---source include/wait_all_purged.inc
-SET DEBUG_SYNC='now SIGNAL delete';
-connection default;
-reap;
CREATE TABLE t5 (i INT, KEY(i)) ENGINE=InnoDB;
INSERT INTO t5 VALUES (-42);
@@ -72,7 +63,7 @@ ALTER TABLE t8 ADD c CHAR(3);
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml';
--send
ALTER TABLE t8 FORCE;
-connection dml;
+connect (dml,localhost,root,,);
SET DEBUG_SYNC='now WAIT_FOR rebuilt';
BEGIN;
INSERT INTO t8 SET i=1;
@@ -178,4 +169,52 @@ UPDATE t11 SET c22 = 1;
--source include/wait_all_purged.inc
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
+--echo #
+--echo # MDEV-15060 Assertion in row_log_table_apply_op after instant ADD
+--echo # when the table is emptied during subsequent ALTER TABLE
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL);
+ALTER TABLE t1 ADD COLUMN b INT NOT NULL;
+connect stop_purge,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connect ddl,localhost,root,,test;
+DELETE FROM t1;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
+send ALTER TABLE t1 FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR copied';
+
+BEGIN;
+INSERT INTO t1 SET b=1;
+ROLLBACK;
+disconnect stop_purge;
+
+# Wait for purge to empty the table.
+# (This is based on wait_all_purged.inc, but there are 2 transactions
+# from the pending ALTER TABLE t1 FORCE.)
+
+let $wait_counter= 300;
+while ($wait_counter)
+{
+ --replace_regex /.*History list length ([0-9]+).*/\1/
+ let $remaining= `SHOW ENGINE INNODB STATUS`;
+ if ($remaining == 'InnoDB 2')
+ {
+ let $wait_counter= 0;
+ }
+ if ($wait_counter)
+ {
+ real_sleep 0.1;
+ dec $wait_counter;
+ }
+}
+echo $remaining transactions not purged;
+
+SET DEBUG_SYNC='now SIGNAL logged';
+disconnect ddl;
+DROP TABLE t1;
+SET DEBUG_SYNC='RESET';
+
SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;