Details
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT); |
INSERT INTO t1 VALUES (10); |
SELECT CASE WHEN 0.1 THEN 'TRUE' ELSE 'FALSE' END FROM t1; |
+--------------------------------------------+
|
| CASE WHEN 0.1 THEN 'TRUE' ELSE 'FALSE' END |
|
+--------------------------------------------+
|
| TRUE |
|
+--------------------------------------------+
|
The above script demonstrates:
- 0.1 is evaluated to TRUE when in CASE
- there is one record in the table t1
Now I run these two queries:
SELECT * FROM t1 WHERE 0.1; |
Empty set (0.00 sec)
|
SELECT * FROM t1 WHERE NOT 0.1; |
Empty set (0.00 sec)
|
Notice, both return empty set. Looks wrong. The query with WHERE 0.1 should return one record.
Attachments
Issue Links
- blocks
-
MDEV-18898 SELECT using wrong index when using operator IN with mixed types
- Closed
-
MDEV-18964 Non-optimal execution of WHERE num_field=const AND num_field=const
- Open