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

The incorrect result of the WHERE condition that contains a negative integer boundary value.

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.16, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.5, 10.6
    • None

    Description

      The processing result of the WHERE condition that contains a negative integer boundary value is incorrect. As a result, the query result is incorrect.

      For example,

      mysql> DROP TABLE IF EXISTS t0;
      Query OK, 0 rows affected (0.00 sec)
       
      mysql> CREATE TABLE `t0` (
          ->   `c0` tinyint NOT NULL,
          ->   KEY `ic2` (`c0`)
          -> );
      Query OK, 0 rows affected (0.01 sec)
       
      mysql> insert into t0 values (127),(-128);
      Query OK, 2 rows affected (0.00 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      mysql> SELECT c0 FROM t0 WHERE (c0 NOT IN (126, -129));
      +-----+
      | c0  |
      +-----+
      | 127 |
      +-----+
      1 row in set (0.00 sec)
      
      

      The query result miss the -128.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            zzzzh Zeng
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.