MySQL spatial geometry validate wkt -


in mysql < 5.7 spatial functions returned null when given invalid wkt, eg:

mysql> select astext(geomfromtext('polygon()'));  +-----------------------------------+ | astext(geomfromtext('polygon()')) | +-----------------------------------+ | null                              | +-----------------------------------+ 1 row in set (0.00 sec) 

but newer mysql same input gives:

error 3037 (22023): invalid gis data provided function st_geometryfromtext. 

is there way of checking whether wkt valid before sending geometry functions? alternatively there setting force geometry functions produce null rather error invalid input?


Comments