| 1 |
SET @old_innodb_enable_xap_unlock_unmodified_for_primary_debug= |
| 2 |
@@GLOBAL.innodb_enable_xap_unlock_unmodified_for_primary_debug; |
| 3 |
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= 1; |
| 4 |
SET @saved_dbug = @@GLOBAL.debug_dbug; |
| 5 |
CREATE TABLE t(id INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; |
| 6 |
InnoDB 0 transactions not purged |
| 7 |
INSERT INTO t VALUES (10), (20), (30); |
| 8 |
connect prevent_purge,localhost,root,,; |
| 9 |
start transaction with consistent snapshot; |
| 10 |
connection default; |
| 11 |
DELETE FROM t WHERE id = 20; |
| 12 |
SET @@GLOBAL.debug_dbug= |
| 13 |
"+d,enable_row_purge_remove_clust_if_poss_low_sync_point"; |
| 14 |
XA START '1'; |
| 15 |
UPDATE t SET id=40 WHERE id=30; |
| 16 |
XA END '1'; |
| 17 |
connection prevent_purge; |
| 18 |
COMMIT; |
| 19 |
SET DEBUG_SYNC= |
| 20 |
'now WAIT_FOR row_purge_remove_clust_if_poss_low_before_delete'; |
| 21 |
SET @@GLOBAL.debug_dbug= |
| 22 |
"-d,enable_row_purge_remove_clust_if_poss_low_sync_point"; |
| 23 |
connection default; |
| 24 |
SET DEBUG_SYNC= |
| 25 |
"lock_rec_unlock_unmodified_start SIGNAL lock_sys_latched WAIT_FOR cont"; |
| 26 |
XA PREPARE '1'; |
| 27 |
connection prevent_purge; |
| 28 |
SET DEBUG_SYNC= 'now SIGNAL row_purge_remove_clust_if_poss_low_cont'; |
| 29 |
SET DEBUG_SYNC= 'now SIGNAL cont'; |
| 30 |
disconnect prevent_purge; |
| 31 |
connection default; |
| 32 |
XA COMMIT '1'; |
| 33 |
SET DEBUG_SYNC="RESET"; |
| 34 |
TRUNCATE TABLE t; |
| 35 |
InnoDB 0 transactions not purged |
| 36 |
INSERT INTO t VALUES (10), (20), (30); |
| 37 |
connect prevent_purge,localhost,root,,; |
| 38 |
start transaction with consistent snapshot; |
| 39 |
connection default; |
| 40 |
DELETE FROM t WHERE id = 20; |
| 41 |
SET @@GLOBAL.debug_dbug= |
| 42 |
"+d,enable_row_purge_remove_clust_if_poss_low_sync_point"; |
| 43 |
SET @@GLOBAL.debug_dbug="+d,skip_lock_release_on_prepare_try"; |
| 44 |
XA START '1'; |
| 45 |
UPDATE t SET id=40 WHERE id=30; |
| 46 |
XA END '1'; |
| 47 |
connection prevent_purge; |
| 48 |
COMMIT; |
| 49 |
SET DEBUG_SYNC= |
| 50 |
'now WAIT_FOR row_purge_remove_clust_if_poss_low_before_delete'; |
| 51 |
SET @@GLOBAL.debug_dbug= |
| 52 |
"-d,enable_row_purge_remove_clust_if_poss_low_sync_point"; |
| 53 |
connection default; |
| 54 |
SET DEBUG_SYNC= |
| 55 |
"lock_rec_unlock_unmodified_start SIGNAL lock_sys_latched WAIT_FOR cont"; |
| 56 |
XA PREPARE '1'; |
| 57 |
connection prevent_purge; |
| 58 |
SET DEBUG_SYNC= 'now SIGNAL row_purge_remove_clust_if_poss_low_cont'; |
| 59 |
SET DEBUG_SYNC= 'now SIGNAL cont'; |
| 60 |
disconnect prevent_purge; |
| 61 |
connection default; |
| 62 |
XA COMMIT '1'; |
| 63 |
SET DEBUG_SYNC="RESET"; |
| 64 |
TRUNCATE TABLE t; |
| 65 |
SET @@GLOBAL.debug_dbug = @saved_dbug; |
| 66 |
DROP TABLE t; |
| 67 |
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= |
| 68 |
@old_innodb_enable_xap_unlock_unmodified_for_primary_debug; |