mirror of
https://github.com/MariaDB/server.git
synced 2025-11-25 17:25:02 +03:00
trx_t::set_skip_lock_inheritance() must be invoked at the very beginning of lock_release_on_prepare(). Currently trx_t::set_skip_lock_inheritance() is invoked at the end of lock_release_on_prepare() when lock_sys and trx are released, and there can be a case when locks on prepare are released, but "not inherit gap locks" bit has not yet been set, and page split inherits lock to supremum. Also reset supremum bit and rebuild waiting queue when XA is prepared. Reviewed by: Marko Mäkelä
32 lines
664 B
Plaintext
32 lines
664 B
Plaintext
--source include/have_innodb.inc
|
|
--source include/count_sessions.inc
|
|
|
|
CREATE TABLE t (
|
|
`a` INT NOT NULL,
|
|
PRIMARY KEY (`a`)
|
|
) ENGINE=InnoDB;
|
|
|
|
|
|
INSERT INTO t VALUES(10);
|
|
INSERT INTO t VALUES(20);
|
|
|
|
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
XA START '1';
|
|
SELECT * FROM t WHERE a > 20 FOR UPDATE;
|
|
INSERT INTO t VALUES(40);
|
|
XA END '1';
|
|
XA PREPARE '1';
|
|
|
|
connect (con1,localhost,root);
|
|
SET innodb_lock_wait_timeout=1;
|
|
# This will be finished with lock wait timeout error if XA PREPARE did not
|
|
# reset lock on supremum
|
|
INSERT INTO t VALUES(50);
|
|
--disconnect con1
|
|
|
|
--connection default
|
|
XA COMMIT '1';
|
|
DROP TABLE t;
|
|
|
|
--source include/wait_until_count_sessions.inc
|