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

Storing '1e-1000000000000' into an INT column produces a wrong result

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1, 10.0, 5.5
    • Fix Version/s: 10.0
    • Component/s: OTHER
    • Labels:
      None

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES ('1e-1000000000000');
      SHOW WARNINGS;
      SELECT * FROM t1;
      

      returns

      +---------+------+--------------------------------------------+
      | Level   | Code | Message                                    |
      +---------+------+--------------------------------------------+
      | Warning | 1264 | Out of range value for column 'a' at row 1 |
      +---------+------+--------------------------------------------+
      1 row in set (0.00 sec)
      
      +------------+
      | a          |
      +------------+
      | 2147483647 |
      +------------+
      1 row in set (0.00 sec)
      

      This is wrong. The expected result is 0.
      The warning also does not look correct.

        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: