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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
    • 10.4
    • OTHER
    • None

    Description

      SET sql_mode='';
      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.