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

COALESCE(12345678900) makes a column of a wrong type and truncates the data

    Details

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

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT 12345678900 AS c1, COALESCE(12345678900) AS c2;
      SELECT * FROM t1;
      SHOW CREATE TABLE t1;
      

      +-------------+------------+
      | c1          | c2         |
      +-------------+------------+
      | 12345678900 | 2147483647 |
      +-------------+------------+
      

      +-------+----------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                   |
      +-------+----------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `c1` bigint(11) NOT NULL,
        `c2` int(11) NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+---------------------------------------------------------------------------------------------------------------
      

      The expected result to create a BIGINT column for both expressions, and return 12345678900 for both columns.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: