mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Bug #30825: Problems when putting a non-spatial index on a GIS column
Fixed the usage of spatial data (and Point in specific) with non-spatial indexes. Several problems : - The length of the Point class was not updated to include the spatial reference system identifier. Fixed by increasing with 4 bytes. - The storage length of the spatial columns was not accounting for the length that is prepended to it. Fixed by treating the spatial data columns as blobs (and thus increasing the storage length) - When creating the key image for comparison in index read wrong key image was created (the one needed for and r-tree search, not the one for b-tree/other search). Fixed by treating the spatial data columns as blobs (and creating the correct kind of image based on the index type).
This commit is contained in:
@@ -167,7 +167,7 @@ count(*)
|
||||
150
|
||||
EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range g g 32 NULL 8 Using where
|
||||
1 SIMPLE t1 range g g 34 NULL 8 Using where
|
||||
SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
|
||||
fid AsText(g)
|
||||
1 LINESTRING(150 150,150 150)
|
||||
@@ -301,7 +301,7 @@ count(*)
|
||||
EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
|
||||
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range g g 32 NULL 4 Using where
|
||||
1 SIMPLE t2 range g g 34 NULL 4 Using where
|
||||
SELECT fid, AsText(g) FROM t2 WHERE Within(g,
|
||||
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
|
||||
fid AsText(g)
|
||||
|
Reference in New Issue
Block a user