[MDEV-12000] ROUND(expr,const_expr_returning_NULL) creates DOUBLE(0,0) Created: 2017-02-06  Updated: 2017-04-07  Resolved: 2017-02-10

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

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

Issue Links:
Relates
relates to MDEV-7542 DOUBLE(0,0) is now converted to DOUBL... Closed
relates to MDEV-12001 Split Item_func_round::fix_length_and... Closed

 Description   

CREATE OR REPLACE TABLE t1 AS SELECT ROUND(10,NULL) AS a;
SHOW CREATE TABLE t1;

+-------+-------------------------------------------------------------------------------------------+
| Table | Create Table                                                                              |
+-------+-------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` double(0,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------+

If I try to create a column of the type DOUBLE(0,0) directly, it gets converted to DOUBLE with not fixed length and dec:

CREATE OR REPLACE TABLE t1 (a DOUBLE(0,0));
SHOW CREATE TABLE t1;

+-------+--------------------------------------------------------------------------------------+
| Table | Create Table                                                                         |
+-------+--------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+--------------------------------------------------------------------------------------+

ROUND should be fixed to be consistent with the direct type declaration.



 Comments   
Comment by Alexander Barkov [ 2017-02-10 ]

The patch for MDEV-12001 fixed this problem.
Pushed into bb-10.2-ext.

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