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

Hybrid functions create a column of an impossible type DOUBLE(256,4)

    Details

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

      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)
      

        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: