[MDEV-12712] CREATE..SELECT for stored functions returning ENUM/SET does not preserve the exact type Created: 2017-05-06  Updated: 2023-04-27

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

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

Epic Link: Data type cleanups

 Description   

DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS ENUM('a') RETURN 'a';
CREATE OR REPLACE TABLE t1 AS SELECT f1();
SHOW CREATE TABLE t1;

+-------+---------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                |
+-------+---------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `f1()` varchar(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------+

Looks wrong. The expected column type is ENUM('a').


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