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)
-
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
- is duplicated by
-
MDEV-40199 Wrong result: DOUBLE/FLOAT UNSIGNED index scan with negative string constant
-
- Closed
-
-
MDEV-41484 Wrong result: "unsigned_col = '-1'" returns the row with value 0 when the column is indexed
-
- Closed
-