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

Rounding functions create a wrong data type for integer input

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
    • 10.4.14, 10.5.5
    • Data types
    • None

    Description

      CREATE OR REPLACE TABLE t1 (a BIGINT);
      CREATE OR REPLACE TABLE t2 AS SELECT
        a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
      DESC t2;
      

      +---------------+---------------+------+-----+---------+-------+
      | Field         | Type          | Null | Key | Default | Extra |
      +---------------+---------------+------+-----+---------+-------+
      | a             | bigint(20)    | YES  |     | NULL    |       |
      | ROUND(a)      | bigint(19)    | YES  |     | NULL    |       |
      | TRUNCATE(a,0) | bigint(19)    | YES  |     | NULL    |       |
      | FLOOR(a)      | decimal(19,0) | YES  |     | NULL    |       |
      | CEILING(a)    | decimal(19,0) | YES  |     | NULL    |       |
      +---------------+---------------+------+-----+---------+-------+
      

      The data types for all columns with functions are not equal to the original data type. Looks wrong. All data types are expected to be bigint(20).

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            Summary Rounding functions create a wrong data type for numeric input Rounding functions create a wrong data type for integer input
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2020-07-31 03:57:48.0 2020-07-31 03:57:48.434
            bar Alexander Barkov made changes -
            Fix Version/s 10.4.14 [ 24305 ]
            Fix Version/s 10.5.5 [ 24423 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 111808 ] MariaDB v4 [ 158166 ]

            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.