| 1 |
--source include/have_innodb.inc |
| 2 |
--source include/count_sessions.inc |
| 3 |
--source include/have_debug.inc |
| 4 |
--source include/have_debug_sync.inc |
| 5 |
--source include/not_embedded.inc |
| 6 |
|
| 7 |
--echo # |
| 8 |
--echo # MDEV-35508: Race condition between purge and secondary index INSERT or UPDATE |
| 9 |
--echo # |
| 10 |
|
| 11 |
SET @old_debug_dbug = @@global.debug_dbug; |
| 12 |
|
| 13 |
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, KEY k1(col2)) ENGINE=Innodb; |
| 14 |
INSERT INTO t1 VALUES(1, 100); |
| 15 |
|
| 16 |
CREATE TABLE t2(col1 INT PRIMARY KEY) Engine=Innodb; |
| 17 |
--source include/wait_all_purged.inc |
| 18 |
|
| 19 |
START TRANSACTION; |
| 20 |
INSERT INTO t2 VALUES(10); |
| 21 |
|
| 22 |
SET DEBUG_SYNC='RESET'; |
| 23 |
|
| 24 |
SET GLOBAL debug_dbug= "+d,btr_force_pessimistic_delete"; |
| 25 |
SET GLOBAL debug_dbug= "+d,enable_row_purge_sec_tree_sync"; |
| 26 |
|
| 27 |
--connect (con1,localhost,root) |
| 28 |
UPDATE t1 SET col2 = 200 WHERE col1 = 1; |
| 29 |
|
| 30 |
--connection default |
| 31 |
SET DEBUG_SYNC= 'now WAIT_FOR purge_sec_tree_begin'; |
| 32 |
SET GLOBAL debug_dbug= "-d,enable_row_purge_sec_tree_sync"; |
| 33 |
|
| 34 |
UPDATE t1 SET col2 = 100 WHERE col1 = 1; |
| 35 |
SET DEBUG_SYNC= 'now SIGNAL purge_sec_tree_execute'; |
| 36 |
|
| 37 |
COMMIT; |
| 38 |
--source include/wait_all_purged.inc |
| 39 |
|
| 40 |
--disconnect con1 |
| 41 |
--source include/wait_until_count_sessions.inc |
| 42 |
|
| 43 |
SELECT * FROM t1; |
| 44 |
CHECK TABLE t1; |
| 45 |
DROP TABLE t1; |
| 46 |
|
| 47 |
SELECT * FROM t2; |
| 48 |
DROP TABLE t2; |
| 49 |
|
| 50 |
SET @@GLOBAL.debug_dbug = @old_debug_dbug; |
| 51 |
SET DEBUG_SYNC='RESET'; |