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

Wrong result for (int_expr IN (mixture of signed and unsigned expressions))

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5, 10.0, 10.1, 10.2, 10.3
    • 10.3.0
    • OTHER

    Description

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a BIGINT, b BIGINT UNSIGNED);
      INSERT INTO t1 VALUES (-9223372036854775808,18446744073709551615);
      SELECT * FROM t1 WHERE -1 IN (a,b);
      

      erroneously returns the row:

      +----------------------+----------------------+
      | a                    | b                    |
      +----------------------+----------------------+
      | -9223372036854775808 | 18446744073709551615 |
      +----------------------+----------------------+
      

      If I now change the left argument to DECIMAL or DOUBLE, it starts to work fine and return an empty set:

      SELECT * FROM t1 WHERE -1.0 IN (a,b);
      SELECT * FROM t1 WHERE -1e0 IN (a,b);
      

      CASE suffers from the same problem. See MDEV-11554.

      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:
                Resolved:

                Git Integration

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