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: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.16, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.4, 10.5, 10.6
    • None
    • 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

        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.