1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-25758 InnoDB spatial indexes miss large geometry fields after MDEV-25459

InnoDB should calculate the MBR for the first field of
spatial index and do the comparison with the clustered
index field MBR. Due to MDEV-25459 refactoring, InnoDB
calculate the length of the first field and fails with
too long column error.
This commit is contained in:
Thirunarayanan Balathandayuthapani
2021-05-24 19:40:47 +05:30
parent ab87fc6c7a
commit c11c5f36d8
3 changed files with 119 additions and 56 deletions

View File

@ -1482,10 +1482,21 @@ FROM buildings, bridges
WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1;
count(*)
1
DROP DATABASE gis_ogs;
#
# Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
#
SELECT ST_Union('', ''), md5(1);
ST_Union('', '') md5(1)
NULL c4ca4238a0b923820dcc509a6f75849b
#
# MDEV-25758 InnoDB spatial indexes miss large geometry
# fields after MDEV-25459
#
CREATE TABLE t1(l LINESTRING NOT NULL, SPATIAL INDEX(l))ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
SELECT GROUP_CONCAT(CONCAT(seq, ' ', seq) SEPARATOR ',') INTO @g FROM seq_0_to_190;
INSERT INTO t1 SET l=ST_GeomFromText(CONCAT('LINESTRING(',@g,',0 0)'));
SELECT COUNT(*) FROM t1 WHERE MBRIntersects(GeomFromText('Polygon((0 0,0 10,10 10,10 0,0 0))'), l);
COUNT(*)
1
DROP TABLE t1;
DROP DATABASE gis_ogs;