18 lines
373 B
Plaintext
18 lines
373 B
Plaintext
create table t(id int primary key);
|
|
insert into t values(1);
|
|
SET @old_innodb_lock_wait_timeout= @@innodb_lock_wait_timeout;
|
|
set global innodb_lock_wait_timeout=2;
|
|
begin;
|
|
select * from t where id=1 for update;
|
|
id
|
|
1
|
|
begin;
|
|
update t set id=2 where id=1;
|
|
commit;
|
|
rollback;
|
|
select * from t;
|
|
id
|
|
2
|
|
set global innodb_lock_wait_timeout= @old_innodb_lock_wait_timeout;
|
|
drop table t;
|