Skip to content

Commit 0aa81a3

Browse files
author
Shaohua Wang
committed
Followup:BUG#21245805 HA_INNOBASE::RECORDS_IN_RANGE() RETURNS CONSTANT
FOR SPATIAL INDEXES Fix innodb_gis.rtree_concurrent_srch and innodb_gis.rtree_old failures with 4k page size.
1 parent 904aabf commit 0aa81a3

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ insert into t1 select * from t1;
1414
insert into t1 select * from t1;
1515
insert into t1 select * from t1;
1616
insert into t1 select * from t1;
17+
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
1718
set session transaction isolation level serializable;
1819
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
1920
SET DEBUG_SYNC = 'RESET';
@@ -217,6 +218,7 @@ select sleep(2);
217218
sleep(2)
218219
0
219220
commit;
221+
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
220222
drop table t1;
221223
drop procedure insert_t1;
222224
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
@@ -227,6 +229,7 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
227229
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
228230
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
229231
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
232+
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
230233
set transaction isolation level serializable;
231234
start transaction;
232235
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
@@ -296,15 +299,14 @@ end|
296299
start transaction;
297300
CALL insert_t1(100);
298301
set @g1 = ST_GeomFromText('Polygon((0 0,0 1000,1000 1000,1000 0,0 0))');
299-
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
300302
SET DEBUG_SYNC= 'rtr_pcur_move_to_next_return SIGNAL siga WAIT_FOR sigb';
301303
select count(*) from t1 where MBRWithin(t1.c2, @g1);;
302304
SET DEBUG_SYNC= 'now WAIT_FOR siga';
303305
rollback;
304306
SET DEBUG_SYNC= 'now SIGNAL sigb';
305307
count(*)
306308
0
307-
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
308309
drop procedure insert_t1;
309310
DROP TABLE t1;
311+
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
310312
SET DEBUG_SYNC = 'RESET';

mysql-test/suite/innodb_gis/r/rtree_old.result

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ INSERT INTO t1 (g) VALUES (ST_GeomFromText('LineString(1 1, 299 299)'));
165165
SELECT count(*) FROM t1;
166166
count(*)
167167
150
168-
EXPLAIN SELECT fid, ST_AsText(g) FROM t1 WHERE MBRWithin(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')) ORDER BY fid;
169-
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
170-
1 SIMPLE t1 NULL range g g 34 NULL 19 100.00 Using where; Using filesort
171-
Warnings:
172-
Note 1003 /* select#1 */ select `test`.`t1`.`fid` AS `fid`,st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrwithin(`test`.`t1`.`g`,<cache>(st_geometryfromtext('Polygon((140 140,160 140,160 160,140 160,140 140))'))) order by `test`.`t1`.`fid`
173168
SELECT fid, ST_AsText(g) FROM t1 WHERE MBRWithin(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')) ORDER BY fid;
174169
fid ST_AsText(g)
175170
1 LINESTRING(150 150,150 150)

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ insert into t1 select * from t1;
3333

3434
connect (a,localhost,root,,);
3535
connection a;
36+
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
3637

3738
set session transaction isolation level serializable;
3839
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
@@ -293,6 +294,7 @@ select sleep(2);
293294
commit;
294295

295296
connection a;
297+
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
296298
disconnect a;
297299
--source include/wait_until_disconnected.inc
298300

@@ -320,6 +322,7 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
320322

321323
connect (a,localhost,root,,);
322324
connection a;
325+
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
323326

324327
set transaction isolation level serializable;
325328
start transaction;
@@ -419,7 +422,6 @@ CALL insert_t1(100);
419422

420423
connection a;
421424
set @g1 = ST_GeomFromText('Polygon((0 0,0 1000,1000 1000,1000 0,0 0))');
422-
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
423425
SET DEBUG_SYNC= 'rtr_pcur_move_to_next_return SIGNAL siga WAIT_FOR sigb';
424426
--send select count(*) from t1 where MBRWithin(t1.c2, @g1);
425427

@@ -431,13 +433,13 @@ SET DEBUG_SYNC= 'now SIGNAL sigb';
431433

432434
connection a;
433435
--reap;
434-
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
435436

436437
connection default;
437438
drop procedure insert_t1;
438439
DROP TABLE t1;
439440

440441
connection a;
442+
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
441443
disconnect a;
442444
--source include/wait_until_disconnected.inc
443445

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ while ($1)
2727
}
2828

2929
SELECT count(*) FROM t1;
30-
EXPLAIN SELECT fid, ST_AsText(g) FROM t1 WHERE MBRWithin(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')) ORDER BY fid;
3130
SELECT fid, ST_AsText(g) FROM t1 WHERE MBRWithin(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')) ORDER BY fid;
3231

3332
DROP TABLE t1;

0 commit comments

Comments
 (0)