Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4.11, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
-
Ubuntu 19.04
Description
Consider the following test case:
CREATE TABLE t0(c0 INT UNIQUE);
|
INSERT INTO t0 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0);
|
SELECT * FROM t0 WHERE c0 < '\n2'; -- expected rows with c0=0 and c0=1, actual: only row with c0=0 is fetched
|
The query only fetches a single row. This is unexpected, because the expression in the WHERE clause evaluates to TRUE for two records:
SELECT c0 < '\n2' FROM t0; -- evaluates to TRUE for two rows
|
When removing the UNIQUE constraint from the column, or inserting fewer NULL values, the query works as expected.
Attachments
Issue Links
- relates to
-
MDEV-21029 Incorrect result for expression with the <=> operator and IS NULL
- In Review