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

The incorrect result of the WHERE condition which contains the IN operation between the unsigned double value with the index and the negative value in String type.

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.16, 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • 10.11, 11.4, 11.8
    • Optimizer
    • None

    Description

      In the WHERE condition of the query statement, the IN operation between the unsigned double value with the index and the negative value in String type is incorrect. As a result, the query result is incorrect.

      mysql> DROP TABLE IF EXISTS t1;
      Query OK, 0 rows affected (0.00 sec)
       
      mysql> CREATE TABLE `t1` (
          ->   `c2` double unsigned NOT NULL,
          ->   KEY `ic3` (`c2`)
          -> );
      Query OK, 0 rows affected (0.01 sec)
       
      mysql> INSERT INTO t1 VALUES (0);
      Query OK, 1 row affected (0.00 sec)
       
      mysql> SELECT c2,(c2 IN ('-1758183929')) FROM t1 WHERE (c2 IN ('-1758183929'));
      +----+-------------------------+
      | c2 | (c2 IN ('-1758183929')) |
      +----+-------------------------+
      |  0 |                       0 |
      +----+-------------------------+
      
      

      As the (c2 IN ('-1758183929') is 0, the condition of the WHERE statement should be wrong as well. The result should be an empty set.

      Attachments

        Issue Links

          Activity

            People

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