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

ROUND(INT, ...) is inconsistent about its data type

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.9
    • N/A
    • Data types
    • None

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT ROUND(0, 209), ROUND(0, @A := 209);
      SHOW COLUMNS FROM t1;

      returns:

      +---------------------+--------------+------+-----+---------+-------+
      | Field               | Type         | Null | Key | Default | Extra |
      +---------------------+--------------+------+-----+---------+-------+
      | ROUND(0, 209)       | int(1)       | NO   |     | 0       |       |
      | ROUND(0, @A := 209) | double(17,0) | NO   |     | 0       |       |
      +---------------------+--------------+------+-----+---------+-------+

      It's not clear why data type for the second ROUND is double.
      The expected type would be the same for both ROUNDs.

      Looks like a regression. 5.5 created int(1) for both ROUNDs.

      Attachments

        Activity

          People

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