mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / innodb_plugin / r / innodb-lock.result
blob5881d4c80b3cb804e39633fc781f52c1c6ca12fc
1 set global innodb_table_locks=1;
2 select @@innodb_table_locks;
3 @@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);
9 set autocommit=0;
10 SELECT * from t1 where id = 0 FOR UPDATE;
11 id      x
12 0       0
13 set autocommit=0;
14 lock table t1 write;
15 update t1 set x=1 where id = 0;
16 select * from t1;
17 id      x
18 0       1
19 commit;
20 update t1 set x=2 where id = 0;
21 commit;
22 unlock tables;
23 select * from t1;
24 id      x
25 0       2
26 commit;
27 drop table t1;
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);
31 commit;
32 SELECT * from t1 where id = 0 FOR UPDATE;
33 id      x
34 0       0
35 set autocommit=0;
36 set @@innodb_table_locks=0;
37 lock table t1 write;
38 update t1 set x=10 where id = 2;
39 SELECT * from t1 where id = 2;
40 id      x
41 2       2
42 UPDATE t1 set x=3 where id = 2;
43 commit;
44 SELECT * from t1;
45 id      x
46 0       0
47 1       1
48 2       3
49 commit;
50 unlock tables;
51 commit;
52 select * from t1;
53 id      x
54 0       0
55 1       1
56 2       10
57 drop table t1;
59 #Bug#12842206 INNODB LOCKING REGRESSION FOR INSERT IGNORE
60 #fixed by re-fixing Bug#7975
61 #aka Bug#11759688 52020: InnoDB can still deadlock on just INSERT...
63 CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB;
64 INSERT INTO t1 VALUES(3,1);
65 BEGIN;
66 INSERT IGNORE INTO t1 VALUES(3,14);
67 BEGIN;
68 INSERT IGNORE INTO t1 VALUES(3,23);
69 SELECT * FROM t1 FOR UPDATE;
70 COMMIT;
71 a       b
72 3       1
73 COMMIT;
74 DROP TABLE t1;