1--source include/have_innodb.inc
2
3CREATE TABLE worklog5743 (col_1_CHAR CHAR(255) , col_2_CHAR CHAR(255) ,
4PRIMARY KEY (col_1_CHAR)) engine = innodb;
5INSERT INTO worklog5743 VALUES(repeat("a", 200) , repeat("o", 200));
6SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
7worklog5743;
8
9--echo "In connection 1"
10--connect (con1,localhost,root,,)
11SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
12worklog5743;
13SELECT COUNT(*) FROM worklog5743;
14
15
16--echo "In connection 2"
17--connect (con2,localhost,root,,)
18START TRANSACTION;
19INSERT INTO worklog5743 VALUES(repeat("b", 200) , repeat("o", 200));
20UPDATE worklog5743 SET col_1_CHAR = repeat("d", 200) WHERE col_1_CHAR =
21repeat("a", 200) AND col_2_CHAR = repeat("o", 200);
22SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
23worklog5743;
24
25
26--echo "In connection 1"
27--connection con1
28SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
29worklog5743;
30
31START TRANSACTION;
32
33SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
34worklog5743;
35SELECT COUNT(*) FROM worklog5743;
36
37--echo "In connection 2"
38--connection con2
39COMMIT;
40SELECT sleep(5);
41
42--echo "In connection 1"
43--connection con1
44SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
45worklog5743;
46SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
47worklog5743;
48SELECT COUNT(*) FROM worklog5743;
49COMMIT;
50
51--connection default
52DROP TABLE worklog5743;
53