Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.2, 5.5.30
-
None
-
None
Description
MDEV-3819 "missing constraints for spatial column types" in revision 3663 seems to have caused this:
When a spatial index is utilized to check a condition using MBRContains or MBRWithin an error is raised if the geometries of the two arguments are not of the same type, so it is e.g. no longer possible to check whether a point is in the MBR of a line or polygon.
How to reproduce:
— test code —
DROP TABLE IF EXISTS t1; |
|
CREATE TABLE t1 ( |
l LINESTRING NOT NULL, |
SPATIAL KEY(l) |
) ENGINE = myisam;
|
|
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(0 0, 1 1)')); |
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(1 1, 2 2)')); |
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(2 2, 3 3)')); |
|
SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)')); |
SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l); |
|
SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)')); |
SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l); |
— Expected result —
COUNT(*)
|
1
|
COUNT(*)
|
1
|
COUNT(*)
|
1
|
COUNT(*)
|
1
|
— Actual result —
COUNT(*)
|
1
|
COUNT(*)
|
1
|
ERROR 1366 (22007) at line 17: Incorrect LINESTRING value: 'POINT' for column 'l' at row 1
|
ERROR 1366 (22007) at line 18: Incorrect LINESTRING value: 'POINT' for column 'l' at row 1
|
Attachments
Issue Links
- relates to
-
MDEV-13348 MBRWithin doesn't work with geo of different type for InnoDB
- Closed