2
# Testing insert and select on a table with two threads
6
-- source include/have_maria.inc
7
set global maria_page_checksum=1;
10
drop table if exists t1;
13
connect (con1,localhost,root,,);
16
create table t1 (i int) engine=maria;
18
lock tables t1 write concurrent;
19
insert into t1 values (1);
20
insert into t1 values (2);
21
/* should see 1 and 2 */
23
select count(*) from t1;
25
connect (con2,localhost,root,,);
27
/* should see nothing */
29
select count(*) from t1;
30
lock tables t1 write concurrent;
31
insert into t1 values (3);
32
insert into t1 values (4);
33
/* should see 3 and 4 */
35
select count(*) from t1;
37
lock tables t1 write concurrent;
38
insert into t1 values (5);
39
/* should see 3, 4 and 5 */
41
select count(*) from t1;
43
connect (con3,localhost,root,,);
45
lock tables t1 write concurrent;
48
select count(*) from t1;
51
insert into t1 values (6);
52
/* Should see 1, 2, 6 */
54
select count(*) from t1;
56
lock tables t1 write concurrent;
57
/* Should see 1, 2, 3, 4 and 6 */
59
select count(*) from t1;
62
/* should see 3, 4, 5 */
64
select count(*) from t1;
66
/* should see 1, 2, 3, 4, 5, 6 */
68
select count(*) from t1;
72
/* should see 1, 2, 3, 4, 5, 6 */
74
select count(*) from t1;
77
insert into t1 values (7);
78
/* should see 3, 4, 7 */
80
select count(*) from t1;
82
/* should see 1, 2, 3, 4, 5, 6, 7 */
84
select count(*) from t1;
90
# Test count(*) for not versioned tables
93
CREATE TABLE t1 (fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, g GEOMETRY NOT NULL, SPATIAL KEY(g) ) transactional=1 row_format=page engine=maria;
95
lock tables t1 write concurrent, t1 as t2 write concurrent;
96
insert into t1 (fid,g) values (NULL,GeomFromText('LineString(0 0,1 1)'));
97
select fid from t1 as t2;
98
select count(*) from t1 as t2;
99
insert into t1 (fid,g) values (NULL,GeomFromText('LineString(0 0,1 1)'));
100
select fid from t1 as t2;
101
select count(*) from t1 as t2;