Debian Codegraph @

mysql-test/suite/innodb_gis/t/rtree_concurrent_srch_2.test

raw
1 # This test case will test concurrent search on R-tree.
2 --source include/have_debug.inc
3 --source include/have_innodb_16k.inc
4
5 CREATE TABLE g (
6 id INT PRIMARY KEY,
7 p GEOMETRY NOT NULL SRID 0,
8 SPATIAL KEY p_idx(p)
9 ) ENGINE=InnoDB;
10
11 delimiter |;
12 create procedure populate_g(IN `rows` INT)
13 begin
14 declare i int default 1;
15 while (i <= `rows`) DO
16 insert into test.g (id, p) values (i, POINT(i, i));
17 set i = i + 1;
18 end while;
19 end|
20 delimiter ;|
21
22 call populate_g(650);
23
24 start transaction;
25 select id from g WHERE MBRContains(ST_GeomFromText('Polygon((100 0,100 5,105
26 5,105 0,100 0))'),p) for update;
27
28 connect (a,localhost,root,,);
29 connection a;
30 set innodb_lock_wait_timeout = 1;
31 set transaction isolation level serializable;
32
33 --error ER_LOCK_WAIT_TIMEOUT
34 insert into g values(1103, POINT(100, 1));
35
36 connect (b,localhost,root,,);
37 connection b;
38 start transaction;
39 select id from g WHERE MBRContains(ST_GeomFromText('Polygon((100 0,100 5,105
40 5,105 0,100 0))'),p) for update;
41
42 connection default;
43 commit;
44
45 connection a;
46 set innodb_lock_wait_timeout = 1;
47 set transaction isolation level serializable;
48
49 --error ER_LOCK_WAIT_TIMEOUT
50 insert into g values(1103, POINT(100, 1));
51 disconnect a;
52 --source include/wait_until_disconnected.inc
53
54 connection b;
55 commit;
56 disconnect b;
57 --source include/wait_until_disconnected.inc
58
59 connection default;
60 DROP TABLE g;
61 DROP PROCEDURE populate_g;
62 set innodb_lock_wait_timeout = default;