1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
DROP TABLE IF EXISTS t1;
connect con0,localhost,root,,;
SET lock_wait_timeout = 4;
connect con1,localhost,root,,;
SET lock_wait_timeout = 4;
connect con2,localhost,root,,;
SET lock_wait_timeout = 4;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b');
connection con1;
LOCK TABLE t1 READ;
connection con0;
UPDATE t1 SET b = CONCAT(b,b);
connection con2;
SELECT * FROM t1;
connection con1;
UNLOCK TABLES;
connection con0;
connection con2;
# Should return the new data
a b
1 ff
2 bb
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b');
connection con1;
LOCK TABLE t1 READ;
connection con0;
UPDATE t1 SET b = CONCAT(b,b,b);
connection con2;
SET lock_wait_timeout = 1;
# Should return old data
SELECT HIGH_PRIORITY * FROM t1;
a b
1 f
2 b
connection con1;
UNLOCK TABLES;
connection con0;
disconnect con1;
disconnect con2;
disconnect con0;
connection default;
DROP TABLE t1;
|