Details
Description
This script:
DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT ZEROFILL); INSERT INTO t1 VALUES (128); SELECT * FROM t1 WHERE a=128; SELECT * FROM t1 WHERE hex(a)='80';
correctly returns one row for both SELECT queries.
if I join the two conditions using AND:
SELECT * FROM t1 WHERE a=128 AND hex(a)='80';
it unexpectedly returns Empty set.
EXPLAIN for the above query tells "Impossible WHERE":
MariaDB [test]> EXPLAIN SELECT * FROM t1 WHERE a=128 AND hex(a)='80'; +------+-------------+-------+------+---------------+------+---------+------+------+------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+------+---------------+------+---------+------+------+------------------+ | 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE | +------+-------------+-------+------+---------------+------+---------+------+------+------------------+
Gliffy Diagrams
Attachments
Issue Links
- blocks
-
MDEV-8728 Fix a number of problems in equal field and equal expression propagation
-
- Closed
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
and without zerofil