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

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.9
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: