Debian Codegraph @

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

raw
1 # WL#6745 InnoDB R-tree support
2 # This test case will test R-tree split.
3
4 --source include/have_innodb.inc
5 --source include/big_test.inc
6 --source include/not_valgrind.inc
7 --source include/have_innodb_16k.inc
8
9 # Create table with R-tree index.
10 create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
11
12 # Insert enough values to let R-tree split.
13 insert into t1 values(1, Point(1,1));
14 insert into t1 values(2, Point(2,2));
15 insert into t1 values(3, Point(3,3));
16 insert into t1 values(4, Point(4,4));
17 insert into t1 values(5, Point(5,5));
18 insert into t1 values(6, Point(6,6));
19 insert into t1 values(7, Point(7,7));
20 insert into t1 values(8, Point(8,8));
21 insert into t1 values(9, Point(9,9));
22
23 insert into t1 select * from t1;
24 insert into t1 select * from t1;
25 insert into t1 select * from t1;
26 insert into t1 select * from t1;
27 insert into t1 select * from t1;
28 insert into t1 select * from t1;
29 insert into t1 select * from t1;
30 insert into t1 select * from t1;
31 insert into t1 select * from t1;
32 insert into t1 select * from t1;
33 insert into t1 select * from t1;
34 insert into t1 select * from t1;
35 start transaction;
36 insert into t1 select * from t1;
37 select count(*) from t1;
38 rollback;
39 check table t1;
40
41 select count(*) from t1;
42
43 set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
44 select count(*) from t1 where MBRWithin(t1.c2, @g1);
45
46 set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
47 select count(*) from t1 where MBRWithin(t1.c2, @g1);
48
49 # Clean up.
50 drop table t1;
51