Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12000

ROUND(expr,const_expr_returning_NULL) creates DOUBLE(0,0)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.1, 10.2, 10.3, 10.0
    • Fix Version/s: 10.3.0
    • Component/s: OTHER
    • Labels:

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: