| 1 |
# WL#6745 InnoDB R-tree support |
| 2 |
# This test case will test R-tree multi level split. |
| 3 |
|
| 4 |
# Not supported in embedded |
| 5 |
--source include/not_embedded.inc |
| 6 |
|
| 7 |
--source include/have_innodb.inc |
| 8 |
--source include/big_test.inc |
| 9 |
let $restart_noprint=2; |
| 10 |
|
| 11 |
# Create table with R-tree index. |
| 12 |
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb; |
| 13 |
|
| 14 |
# Insert enough values to let R-tree split. |
| 15 |
delimiter |; |
| 16 |
create procedure insert_t1(IN total int) |
| 17 |
begin |
| 18 |
declare i int default 1; |
| 19 |
while (i <= total) DO |
| 20 |
insert into t1 values (i, Point(i, i)); |
| 21 |
set i = i + 1; |
| 22 |
end while; |
| 23 |
end| |
| 24 |
delimiter ;| |
| 25 |
|
| 26 |
# Test level 1 rtree. |
| 27 |
CALL insert_t1(5000); |
| 28 |
select count(*) from t1; |
| 29 |
|
| 30 |
# Check table. |
| 31 |
check table t1; |
| 32 |
|
| 33 |
# Test level 2 rtree. |
| 34 |
truncate table t1; |
| 35 |
CALL insert_t1(10000); |
| 36 |
select count(*) from t1; |
| 37 |
|
| 38 |
drop index c2 on t1; |
| 39 |
|
| 40 |
create spatial index idx on t1(c2); |
| 41 |
|
| 42 |
show create table t1; |
| 43 |
|
| 44 |
# Check table. |
| 45 |
check table t1; |
| 46 |
|
| 47 |
# Test level 3 rtree. |
| 48 |
truncate table t1; |
| 49 |
|
| 50 |
# Test crash recovery. |
| 51 |
# |
| 52 |
# |
| 53 |
|
| 54 |
call mtr.add_suppression("InnoDB: A copy of page \[page id: space=[0-9]+, page number=[0-9]+\] in the doublewrite buffer slot [0-9]+ is not within space bounds"); |
| 55 |
|
| 56 |
# Test rtree enlarge recovery. |
| 57 |
START TRANSACTION; |
| 58 |
CALL insert_t1(5000); |
| 59 |
|
| 60 |
COMMIT; |
| 61 |
|
| 62 |
--let $shutdown_timeout=0 |
| 63 |
--source include/restart_mysqld.inc |
| 64 |
|
| 65 |
# Clean up. |
| 66 |
drop procedure insert_t1; |
| 67 |
drop table t1; |