Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 11.5(EOL)
-
None
-
None
Description
This script:
CREATE OR REPLACE TABLE t1 (a INET6); |
INSERT INTO t1 VALUES ('::'),('::1'); |
SELECT * FROM t1 WHERE a IS TRUE; |
produces the following output:
+------+
|
| a |
|
+------+
|
| ::1 |
|
+------+
|
Looks good so far.
Now if I run:
SELECT * FROM t1 WHERE a; |
it returns an unexpected error:
ERROR 4078 (HY000): Illegal parameter data types inet6 and bigint for operation '<>'
|
The problem is that the condition:
WHERE column |
gets rewritten by the parser into:
WHERE column<>0 |
which is not applicable in case of INET6.
It should probably be rewritten to:
WHERE column IS TRUE |
Attachments
Issue Links
- relates to
-
MDEV-33999 Unexpected result when casting decimal in WHERE clause
- Confirmed
-
MDEV-34114 Incorrect Query Result when Adding Columns
- Open
-
MDEV-34123 CONCAT Function Returns Unexpected Empty Set in Query
- Closed
-
MDEV-34498 Applying NOT twice on an integer results in wrong result in WHERE condition
- Confirmed