| 1 |
create table t1 (c1 int, c2 geometry srid 4326 not null, spatial index (c2))engine=innodb; |
| 2 |
insert into t1 values(1, ST_SRID(Point(1,1), 4326)); |
| 3 |
insert into t1 values(2, ST_SRID(Point(2,2), 4326)); |
| 4 |
insert into t1 values(3, ST_SRID(Point(3,3), 4326)); |
| 5 |
insert into t1 values(4, ST_SRID(Point(4,4), 4326)); |
| 6 |
insert into t1 values(5, ST_SRID(Point(5,5), 4326)); |
| 7 |
insert into t1 values(6, ST_SRID(Point(6,6), 4326)); |
| 8 |
insert into t1 values(7, ST_SRID(Point(7,7), 4326)); |
| 9 |
insert into t1 values(8, ST_SRID(Point(8,8), 4326)); |
| 10 |
insert into t1 values(9, ST_SRID(Point(9,9), 4326)); |
| 11 |
insert into t1 select * from t1; |
| 12 |
insert into t1 select * from t1; |
| 13 |
insert into t1 select * from t1; |
| 14 |
insert into t1 select * from t1; |
| 15 |
insert into t1 select * from t1; |
| 16 |
insert into t1 select * from t1; |
| 17 |
SET SESSION debug="+d, rtr_page_need_second_split"; |
| 18 |
insert into t1 select * from t1; |
| 19 |
SET SESSION debug="-d, rtr_page_need_second_split"; |
| 20 |
delete from t1; |
| 21 |
insert into t1 values(1, ST_SRID(Point(1,1), 4326)); |
| 22 |
insert into t1 values(2, ST_SRID(Point(2,2), 4326)); |
| 23 |
insert into t1 values(3, ST_SRID(Point(3,3), 4326)); |
| 24 |
insert into t1 values(4, ST_SRID(Point(4,4), 4326)); |
| 25 |
insert into t1 values(5, ST_SRID(Point(5,5), 4326)); |
| 26 |
insert into t1 values(6, ST_SRID(Point(6,6), 4326)); |
| 27 |
insert into t1 values(7, ST_SRID(Point(7,7), 4326)); |
| 28 |
insert into t1 values(8, ST_SRID(Point(8,8), 4326)); |
| 29 |
insert into t1 values(9, ST_SRID(Point(9,9), 4326)); |
| 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 |
insert into t1 select * from t1; |
| 36 |
insert into t1 select * from t1; |
| 37 |
insert into t1 select * from t1; |
| 38 |
start transaction; |
| 39 |
insert into t1 select * from t1; |
| 40 |
rollback; |
| 41 |
check table t1; |
| 42 |
Table Op Msg_type Msg_text |
| 43 |
test.t1 check status OK |
| 44 |
insert into t1 select * from t1; |
| 45 |
insert into t1 select * from t1; |
| 46 |
insert into t1 select * from t1; |
| 47 |
insert into t1 select * from t1; |
| 48 |
insert into t1 select * from t1; |
| 49 |
check table t1; |
| 50 |
Table Op Msg_type Msg_text |
| 51 |
test.t1 check status OK |
| 52 |
select count(*) from t1; |
| 53 |
count(*) |
| 54 |
73728 |
| 55 |
set @g1 = ST_GeomFromText('Polygon((-90 -180,-90 180,90 180,90 -180,-90 -180))', 4326); |
| 56 |
select count(*) from t1 where MBRWithin(t1.c2, @g1); |
| 57 |
count(*) |
| 58 |
0 |
| 59 |
set @g1 = ST_GeomFromText('Polygon((10 10,10 180,90 180,90 10,10 10))', 4326); |
| 60 |
select count(*) from t1 where MBRWithin(t1.c2, @g1); |
| 61 |
count(*) |
| 62 |
0 |
| 63 |
drop index c2 on t1; |
| 64 |
create spatial index idx2 on t1(c2); |
| 65 |
show create table t1; |
| 66 |
Table Create Table |
| 67 |
t1 CREATE TABLE `t1` ( |
| 68 |
`c1` int DEFAULT NULL, |
| 69 |
`c2` geometry NOT NULL /*!80003 SRID 4326 */, |
| 70 |
SPATIAL KEY `idx2` (`c2`) |
| 71 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 72 |
set @g1 = ST_GeomFromText('Polygon((-90 -180,-90 180,90 180,90 -180,-90 -180))', 4326); |
| 73 |
select count(*) from t1 where MBRWithin(t1.c2, @g1); |
| 74 |
count(*) |
| 75 |
0 |
| 76 |
SET GLOBAL innodb_fast_shutdown = 0; |
| 77 |
# restart: --innodb-read-only |
| 78 |
set @g1 = ST_GeomFromText('Polygon((-90 -180,-90 180,90 180,90 -180,-90 -180))', 4326); |
| 79 |
select count(*) from t1 where MBRWithin(t1.c2, @g1); |
| 80 |
count(*) |
| 81 |
0 |
| 82 |
set @g1 = ST_GeomFromText('Polygon((2 2,2 180,90 180,90 2,2 2))', 4326); |
| 83 |
select count(*) from t1 where MBRWithin(t1.c2, @g1); |
| 84 |
count(*) |
| 85 |
57344 |
| 86 |
# restart |
| 87 |
drop table t1; |