[MDEV-9425] Hybrid functions and UNION do not preserve spatial REF_SYSTEM_ID Created: 2016-01-16  Updated: 2019-11-19

Status: Open
Project: MariaDB Server
Component/s: Data types, GIS
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-4912 Data type plugin API version 1 Closed
relates to MDEV-9405 SP do not preserve geometry type Open
relates to MDEV-11303 MIN and MAX do not preserve GEOMETRY ... Open
relates to MDEV-11304 SP do not preserve SRID Open
Epic Link: Data type cleanups

 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (g GEOMETRY REF_SYSTEM_ID=101);
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 AS SELECT g AS g_column, COALESCE(g) AS g_coalesce FROM t1;
DROP TABLE IF EXISTS t3;
CREATE TABLE t3 AS SELECT g AS g_union FROM t1 UNION SELECT g FROM t1;
SELECT G_TABLE_NAME, G_GEOMETRY_COLUMN, SRID FROM INFORMATION_SCHEMA.GEOMETRY_COLUMNS;

returns

+--------------+-------------------+------+
| G_TABLE_NAME | G_GEOMETRY_COLUMN | SRID |
+--------------+-------------------+------+
| t1           | g                 |  101 |
| t2           | g_column          |  101 |
| t2           | g_coalesce        |    0 |
| t3           | g_union           |    0 |
+--------------+-------------------+------+

Notice, g_column preserved the original REF_SYSTEM_ID, which is correct.
More complex cases (e.g. g_coalesce and g_union) did not, as they should.


Generated at Thu Feb 08 07:34:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.