diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-26 10:13:29 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-26 17:40:20 +0300 |
commit | c795a9f3fea60d303645c6729834cdd389aaed0d (patch) | |
tree | 3fe3acce92799fb25d6ef746c3a0982f53a2a0c7 | |
parent | 06ec56f579e6de647fd38854da31b6324100faf9 (diff) | |
download | mariadb-git-c795a9f3fea60d303645c6729834cdd389aaed0d.tar.gz |
MDEV-12004: Add the Bug#28825718 test case
Adapt the test case from
mysql/mysql-server@2bbbcddd903626c84c610dd2ed82cc22ee4d6cde
(MySQL 5.7.26).
-rw-r--r-- | mysql-test/suite/gcol/r/innodb_virtual_debug.result | 30 | ||||
-rw-r--r-- | mysql-test/suite/gcol/t/innodb_virtual_debug.test | 34 |
2 files changed, 63 insertions, 1 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result index 50b714566d9..806cf1a98c8 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result @@ -94,3 +94,33 @@ NULL 29 DROP TABLE t; SET DEBUG_SYNC = 'RESET'; +# +# Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT +# +CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1(a, b) VALUES(1, 1); +connect con1,localhost,root,,; +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2'; +SET lock_wait_timeout = 1; +ALTER TABLE t1 ADD UNIQUE INDEX(c, b); +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR s1'; +SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3'; +INSERT INTO t1(a, b) VALUES(2, 2); +connection con1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SET DEBUG_SYNC = 'now SIGNAL s3'; +disconnect con1; +connection default; +SET DEBUG_SYNC = 'RESET'; +ALTER TABLE t1 ADD KEY(b); +INSERT INTO t1(a, b) VALUES(3, 3); +SELECT * FROM t1; +a b c +1 1 2 +2 2 3 +3 3 4 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test index ccdd16c9ebe..40446b991cd 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_debug.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test @@ -60,7 +60,6 @@ SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR --send ALTER TABLE t FORCE connection con1; - SET DEBUG_SYNC = 'now WAIT_FOR start_create'; start transaction; update t set a=1 where a = 0; @@ -280,4 +279,37 @@ disconnect con1; } SET DEBUG_SYNC = 'RESET'; + +--echo # +--echo # Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT +--echo # + +CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB; + +INSERT INTO t1(a, b) VALUES(1, 1); + +connect (con1,localhost,root,,); +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2'; +SET lock_wait_timeout = 1; +--send ALTER TABLE t1 ADD UNIQUE INDEX(c, b) + +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR s1'; +SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3'; +--send INSERT INTO t1(a, b) VALUES(2, 2) + +connection con1; +--error ER_LOCK_WAIT_TIMEOUT +reap; +SET DEBUG_SYNC = 'now SIGNAL s3'; +disconnect con1; +connection default; +reap; +SET DEBUG_SYNC = 'RESET'; +ALTER TABLE t1 ADD KEY(b); +INSERT INTO t1(a, b) VALUES(3, 3); +SELECT * FROM t1; +CHECK TABLE t1; +DROP TABLE t1; + --source include/wait_until_count_sessions.inc |