Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
135 additions
and
30 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
mysql-test/suite/innodb/r/xa_prepare_reset_supremum_lock.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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; | ||
a | ||
INSERT INTO t VALUES(40); | ||
XA END '1'; | ||
XA PREPARE '1'; | ||
connect con1,localhost,root; | ||
SET innodb_lock_wait_timeout=1; | ||
INSERT INTO t VALUES(50); | ||
disconnect con1; | ||
connection default; | ||
XA COMMIT '1'; | ||
DROP TABLE t; |
31 changes: 31 additions & 0 deletions
31
mysql-test/suite/innodb/t/xa_prepare_reset_supremum_lock.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters