[MDEV-12601] Hybrid functions create a column of an impossible type DOUBLE(256,4) Created: 2017-04-27  Updated: 2017-04-27  Resolved: 2017-04-27

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.3.1

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 Description   

CREATE OR REPLACE TABLE t1 (a DOUBLE(255,4),b DOUBLE(255,3));
CREATE OR REPLACE TABLE t2 AS SELECT COALESCE(a,b) FROM t1;
SHOW CREATE TABLE t2;

+-------+---------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                            |
+-------+---------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `COALESCE(a,b)` double(256,4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------+

Notice, a column of an impossible type double(256,4) was created.

If I try to create a column of the same type directly, I correctly get an error:

CREATE OR REPLACE TABLE t1 (a DOUBLE(256,4));

ERROR 1439 (42000): Display width out of range for 'a' (max = 255)



 Comments   
Comment by Alexander Barkov [ 2017-04-27 ]

Pushed to bb-10.2-ext

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