WL#2388: GeomCollection synonym for GeometryCollection

Affects: Server-8.0   —   Status: Complete   —   Priority: Medium

MySQL currently supports only a non-standard name for the geometry collection data type, "GEOMETRYCOLLECTION". This WL adds the OGC SFA and SQL/MM compliant name "GEOMCOLLECTION".

The standard compliant name, "GEOMCOLLECTION", will be the default, and "GEOMETRYCOLLECTION" will be an alias accepted in user input. That means that INFORMATION_SCHEMA, SHOW CREATE TABLE and other places that type names are output by the server, "GEOMCOLLECTION" will be used.

The geometry collection construction function, "GEOMETRYCOLLECTION", is named after the column type. An alias "GEOMCOLLECTION" will be added for this function. The new name will be the default and visible, e.g., in EXPLAIN output.

F-1
The data type GEOMCOLLECTION MUST be allowed in column definitions as an alias for type GEOMETRYCOLLECTION.
F-2
The column DATA_TYPE in view INFORMATION_SCHEMA.COLUMNS MUST contain "GEOMCOLLECTION" as data type for geometry collection columns.
F-3
The column GEOMETRY_TYPE_NAME in view INFORMATION_SCHEMA.ST_GEOMETRY_COLUMNS MUST contain "GEOMCOLLECTION" as data type for geometry collection columns.
F-4
SHOW CREATE TABLE MUST contain "GEOMCOLLECTION" as data type for geometry collection columns.
F-5
The ST_GEOMETRYTYPE function MUST return "GEOMCOLLECTION" if called with a geometry collection argument.
F-6
Function GEOMCOLLECTION MUST behave as function GEOMETRYCOLLECTION.
F-7
EXPLAIN output (the warning that displays the query) MUST show the function name "GEOMCOLLECTION" where the GEOMCOLLECTION or GEOMETRYCOLLECTION functions are used.
I-1
No new files.
I-2
Interface SQL01 is extended with a new name, "GEOMCOLLECTION", for the geometry collection data type.

Interface SQL01 is extended with a new name, "GEOMCOLLECTION", for the geometry collection construction function GEOMETRYCOLLECTION.
I-3
No new commands.
I-4
No new tools.
I-5
No changes to the semantics of existing functionality. The data type name returned by INFORMATION_SCHEMA views and function ST_GEOMETRYTYPE changes from "GEOMETRYCOLLECTION" to "GEOMCOLLECTION".
I-6
No new errors or warnings. The data types printed in some error messages changes from "GEOMETRYCOLLECTION" to "GEOMCOLLECTION".

Contents


Parser

The names of the data type and the geometry collection construction function is defined in the parser. The parser is extended with a new GEOMCOLLECTION_SYM symbol to allow both "GEOMETRYCOLLECTION" and "GEOMCOLLECTION" as names for the data type and function.

INFORMATION_SCHEMA

The type name for column DATA_TYPE in view INFORMATION_SCHEMA.COLUMNS and in SHOW CREATE TABLE comes from Field_geom::sql_type(). This function is changed to return "geomcollection".

Column GEOMETRY_TYPE_NAME in view INFORMATION_SCHEMA.ST_GEOMETRY_COLUMNS comes from INFORMATION_SCHEMA.COLUMNS. The WHERE condition in the view is updated to pick up geometry collection columns that now are reported to have a different data type.

Item Hierarchy

Item_func_spatial_collection::func_name() is modified to return the function name "geomcollection" for geometry collections. This affects EXPLAIN output and error messages.

A similar change is made to gis::Functor so that error messages will contain the new default data type.

WKT

The WKT parser and generators rely on the Geometry::Class_info classes to recognize and produce geometry type names. Since the default data type name is no longer the same as the WKT name for the geometry, these are overridden.

Geometry::find_class() is only used when parsing WKT, so it is modified to only recognize "GEOMETRYCOLLECTION", even if the Geometry::Class_info name is "GEOMCOLLECTION". Similarly, Geometry::as_wkt() is modified to produce "GEOMETRYCOLLECTION" instead of the Geometry::Class_info name.