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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1(EOL), 10.2(EOL)
    • 10.3.1
    • OTHER
    • 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

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              1 Vote for this issue
              Watchers:
              3 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.