[MDEV-10834] CREATE TABLE t1 AS SELECT spfunc() makes a field with a wrong data type Created: 2016-09-19  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: Data types, Stored routines
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

DROP FUNCTION IF EXISTS f1;
DROP TABLE IF EXISTS t1;
CREATE FUNCTION f1() RETURNS VARCHAR(4000) RETURN 'test';
CREATE TABLE t1 AS SELECT f1() AS c1;
SHOW CREATE TABLE t1;

returns

CREATE TABLE `t1` (
 `c1` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Notice, it creates a column of the TEXT data type. The expected data type is VARCHAR(4000).


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