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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0, 10.1, 10.2, 10.3
    • 10.3.0
    • OTHER

    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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.