MDEV-35103 CREATE TABLE AS SELECT ST_VALIDATE creates a column with datatype point, not geometry

Changes the type handler for geometry validate from 'point' to 'geometry'
This commit is contained in:
Dave Gosselin 2024-12-16 15:57:17 -05:00 committed by Dave Gosselin
parent 6699c1a56b
commit 9eec22e263
3 changed files with 16 additions and 1 deletions

View file

@ -397,3 +397,10 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')) c;
c
1
#
# MDEV-35103 CREATE TABLE AS SELECT ST_VALIDATE creates a column with datatype point, not geometry
#
create or replace table tb1 as SELECT st_validate(POINTFROMTEXT(' POINT( 4 1 ) ')) a;
create or replace table tb1 as SELECT st_validate(ST_GeomFromText (' linestring( 4 1,4 4 ) ')) a;
create table tb2 as SELECT (st_validate (ST_collect(( POINTFROMTEXT(' POINT( 4 1 ) ') )) )) a;
drop table tb1, tb2;

View file

@ -379,3 +379,11 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')) c;
--echo #
--echo # MDEV-35103 CREATE TABLE AS SELECT ST_VALIDATE creates a column with datatype point, not geometry
--echo #
create or replace table tb1 as SELECT st_validate(POINTFROMTEXT(' POINT( 4 1 ) ')) a;
create or replace table tb1 as SELECT st_validate(ST_GeomFromText (' linestring( 4 1,4 4 ) ')) a;
create table tb2 as SELECT (st_validate (ST_collect(( POINTFROMTEXT(' POINT( 4 1 ) ') )) )) a;
drop table tb1, tb2;

View file

@ -1060,7 +1060,7 @@ public:
String *val_str(String *) override;
const Type_handler *type_handler() const override
{
return &type_handler_point;
return &type_handler_geometry;
}
Item *do_get_copy(THD *thd) const override
{ return get_item_copy<Item_func_validate>(thd, this); }