Debian Codegraph @

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

raw
1 # WL#6745 InnoDB R-tree support
2 # This test case will test R-tree multi level split.
3
4 --source include/have_innodb.inc
5 --source include/big_test.inc
6 --source include/not_valgrind.inc
7 --source include/have_debug.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 delimiter |;
14 create procedure insert_t1(IN total int)
15 begin
16 declare i int default 1;
17 while (i <= total) DO
18 insert into t1 values
19 (i, Point(i, i)),
20 (i + 1, Point(i + 1, i + 1)),
21 (i + 2, Point(i + 2, i + 2)),
22 (i + 3, Point(i + 3, i + 3)),
23 (i + 4, Point(i + 4, i + 4)),
24 (i + 5, Point(i + 5, i + 5)),
25 (i + 6, Point(i + 6, i + 6)),
26 (i + 7, Point(i + 7, i + 7)),
27 (i + 8, Point(i + 8, i + 8)),
28 (i + 9, Point(i + 9, i + 9));
29 set i = i + 10;
30 end while;
31 end|
32 delimiter ;|
33
34 # Test level 1 rtree.
35 CALL insert_t1(5000);
36 select count(*) from t1;
37
38 # Check table.
39 check table t1;
40
41 # Test level 2 rtree.
42 truncate table t1;
43 CALL insert_t1(10000);
44 select count(*) from t1;
45
46 drop index c2 on t1;
47
48 create spatial index idx on t1(c2);
49
50 show create table t1;
51
52 SET @save_dbug = @@SESSION.debug_dbug;
53 SET debug_dbug='+d,row_merge_ins_spatial_fail';
54 --error ER_GET_ERRNO
55 create spatial index idx2 on t1(c2);
56 SET @@SESSION.debug_dbug = @save_dbug;
57 show create table t1;
58
59 # Check table.
60 check table t1;
61
62 # Test level 3 rtree.
63 truncate table t1;
64 CALL insert_t1(100000);
65 select count(*) from t1;
66
67 # Check table.
68 check table t1;
69
70 truncate table t1;
71
72 # Clean up.
73 drop procedure insert_t1;
74 drop table t1;