Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (f1 enum('1','2','3','4','5')) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES (1),(2);
|
DROP TABLE IF EXISTS t2;
|
CREATE TABLE t2 AS SELECT AVG(f1),AVG(COALESCE(f1)) FROM t1;
|
SHOW CREATE TABLE t2;
|
returns
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`AVG(f1)` decimal(5,4) DEFAULT NULL,
|
`AVG(COALESCE(f1))` double DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
Perhaps it should create columns of the same type.
It's not clear what type it should be. ENUM is a special kind of string. But it has INT-alike behavior in some cases.