📄 innodb_unsafe_binlog.result
字号:
drop table if exists t1,t2;create table t1 (id int not null, f_id int not null, f int not null,primary key(f_id, id)) engine=innodb;create table t2 (id int not null,s_id int not null,s varchar(200),primary key(id)) engine=innodb;INSERT INTO t1 VALUES (8, 1, 3);INSERT INTO t1 VALUES (1, 2, 1);INSERT INTO t2 VALUES (1, 0, '');INSERT INTO t2 VALUES (8, 1, '');commit;DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)WHERE mm.id IS NULL;select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)where mm.id is null lock in share mode;id f_id fdrop table t1,t2;create table t1 (id int not null, f_id int not null, f int not null,primary key(id),key(f_id)) engine=innodb;create table t2 (id int not null,s_id int not null,s varchar(200),primary key(id),key(s_id)) engine=innodb;INSERT INTO t1 VALUES (8, 1, 3);INSERT INTO t1 VALUES (1, 2, 1);INSERT INTO t2 VALUES (1, 0, '');INSERT INTO t2 VALUES (8, 1, '');commit;delete ml.* from t1 as ml left join t2 as mm on (mm.s_id=ml.f_id) where mm.s is null;select ml.* from t1 as ml left join t2 as mm on (mm.s_id=ml.f_id) where mm.s is null lock in share mode;id f_id fdrop table t1,t2;create table t1(a int not null, b int, primary key(a)) engine=innodb;insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);commit;set autocommit = 0;select * from t1 lock in share mode;a b1 12 23 14 25 16 2update t1 set b = 5 where b = 1;set autocommit = 0;select * from t1 where a = 2 and b = 2 for update;ERROR HY000: Lock wait timeout exceeded; try restarting transactioncommit;commit;drop table t1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -