[MDEV-3819] missing constraints for spatial column types Created: 2012-10-25  Updated: 2022-12-07  Resolved: 2013-03-03

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.28
Fix Version/s: 5.5.30

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None
Environment:

all platforms


Issue Links:
Relates
relates to MDEV-3930 Spatial functions: Return error inste... Open
relates to MDEV-4365 GIS index regression on 5.5.30 Closed

 Description   

SPATIAL columns which are not defined as GEOMETRY, e.g. POINT, LINE, POLYGON accept all kind of geometries.

How to repeat:

create table t1 (a point not null, spatial index(a));
 
SET @poly = 'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))';
 
insert into t1 values(GeomFromText(@poly));
>>Query OK, 1 row affected (0.29 sec)

Testing the same with PostGIS:

test=# insert into t1 values (GeomFromText('POLYGON(1 1, 2 2, 1 1)'));
ERROR:  column "a" is of type point but expression is of type geometry


Generated at Thu Feb 08 06:51:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.