2011-12-14 14:58:22 +01:00
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
# Verifying that X_LOCK not acquired
|
|
|
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
|
|
|
INSERT INTO t1 VALUES (1);
|
2016-03-25 20:51:22 +04:00
|
|
|
connect conn1,localhost,root,,;
|
|
|
|
connection conn1;
|
2011-12-14 14:58:22 +01:00
|
|
|
SET autocommit=0;
|
|
|
|
SET innodb_fake_changes=1;
|
|
|
|
BEGIN;
|
|
|
|
SELECT * FROM t1 FOR UPDATE;
|
|
|
|
a
|
|
|
|
1
|
2016-03-25 20:51:22 +04:00
|
|
|
connection default;
|
2011-12-14 14:58:22 +01:00
|
|
|
SET innodb_lock_wait_timeout=3;
|
|
|
|
UPDATE t1 SET a=2;
|
|
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
|
|
SELECT * FROM t1 LOCK IN SHARE MODE;
|
|
|
|
a
|
|
|
|
1
|
2016-03-25 20:51:22 +04:00
|
|
|
connection conn1;
|
2011-12-14 14:58:22 +01:00
|
|
|
ROLLBACK;
|
|
|
|
SET innodb_fake_changes=default;
|
|
|
|
DROP TABLE t1;
|