Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL)
-
None
Description
Mixing ENUM and GEOMETRY in hybrid functions creates a LONGBLOB column:
DROP TABLE IF EXISTS t1,t2; |
CREATE TABLE t1 (a ENUM('a'), b Geometry); |
CREATE TABLE t2 AS SELECT LEAST(a,b), COALESCE(a,b) FROM t1; |
SHOW CREATE TABLE t2; |
+-------+------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+------------------------------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`LEAST(a,b)` longblob DEFAULT NULL,
|
`COALESCE(a,b)` longblob DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+------------------------------------------------------------------------------------------------------------------------------------------+
|
Mixing ENUM and GEOMETRY for UNION returns an error:
DROP TABLE t2; |
CREATE TABLE t2 AS SELECT a FROM t1 UNION SELECT b FROM t1; |
ERROR 4053 (HY000): Illegal parameter data types enum and geometry for operation 'UNION'
|
It would be nice to have consistent behavior.
The problem is that hybrid functions and UNION treat arguments differently:
- functions operate in terms of field type and see ENUM as VARCHAR.
- UNION operates in term of real field type and see ENUM as ENUM.
Perhaps hybrid functions should be fixed to operate in terms of real field type.