1
set global innodb_table_locks=1;
2
select @@innodb_table_locks;
5
drop table if exists t1;
6
set @@innodb_table_locks=1;
7
create table t1 (id integer, x integer) engine=INNODB;
8
insert into t1 values(0, 0);
10
SELECT * from t1 where id = 0 FOR UPDATE;
15
update t1 set x=1 where id = 0;
20
update t1 set x=2 where id = 0;
28
set @@innodb_table_locks=0;
29
create table t1 (id integer primary key, x integer) engine=INNODB;
30
insert into t1 values(0, 0),(1,1),(2,2);
32
SELECT * from t1 where id = 0 FOR UPDATE;
36
set @@innodb_table_locks=0;
38
update t1 set x=10 where id = 2;
39
SELECT * from t1 where id = 2;
42
UPDATE t1 set x=3 where id = 2;