1
by brian
clean slate |
1 |
drop table if exists t1;
|
2 |
create table t1 (a int) engine=innodb;
|
|
3 |
begin;
|
|
4 |
insert into t1 values(1);
|
|
5 |
flush tables with read lock;
|
|
6 |
select * from t1;
|
|
7 |
a
|
|
8 |
commit;
|
|
9 |
select * from t1;
|
|
10 |
a
|
|
11 |
unlock tables;
|
|
12 |
begin;
|
|
13 |
select * from t1 for update;
|
|
14 |
a
|
|
15 |
1
|
|
16 |
begin;
|
|
17 |
select * from t1 for update;
|
|
18 |
flush tables with read lock;
|
|
19 |
commit;
|
|
20 |
a
|
|
21 |
1
|
|
22 |
unlock tables;
|
|
23 |
commit;
|
|
24 |
begin;
|
|
25 |
insert into t1 values(10);
|
|
26 |
flush tables with read lock;
|
|
27 |
commit;
|
|
28 |
unlock tables;
|
|
29 |
flush tables with read lock;
|
|
30 |
unlock tables;
|
|
31 |
begin;
|
|
32 |
select * from t1;
|
|
33 |
a
|
|
34 |
1
|
|
35 |
10
|
|
36 |
show create database test;
|
|
37 |
Database Create Database
|
|
38 |
test CREATE DATABASE "test" /*!40100 DEFAULT CHARACTER SET latin1 */
|
|
39 |
drop table t1;
|