mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
2d259187a2
If lock type is LOCK_GAP or LOCK_ORDINARY, and the transaction holds implicit lock for the record, then explicit gap-lock will not be set for the record, as lock_rec_convert_impl_to_expl() returns true and lock_rec_convert_impl_to_expl() bypasses lock_rec_lock() call. The fix converts explicit lock to implicit one if requested lock type is not LOCK_REC_NOT_GAP. innodb_information_schema test result is also changed as after the fix the following statements execution: SET autocommit=0; INSERT INTO t1 VALUES (5,10); SELECT * FROM t1 FOR UPDATE; leads to additional gap lock requests.
17 lines
443 B
Text
17 lines
443 B
Text
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB;
|
|
INSERT INTO t VALUES (10), (30);
|
|
connect con1,localhost,root,,;
|
|
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
BEGIN;
|
|
INSERT INTO t VALUES (20);
|
|
SELECT * FROM t WHERE a BETWEEN 10 AND 30;
|
|
a
|
|
10
|
|
20
|
|
30
|
|
connection default;
|
|
SET session innodb_lock_wait_timeout=1;
|
|
INSERT INTO t VALUES (15);
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
disconnect con1;
|
|
DROP TABLE t;
|