-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Wrong results of query with setting transform_null_in=1. #15310
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release
Description
Describe the bug
Setting transform_null_in works incorrectly with IN operator over tuples.
How to reproduce
1.
CREATE TABLE null_in_1 (u UInt32, n Nullable(UInt32)) ENGINE = Memory;
INSERT INTO null_in_1 VALUES (1, NULL), (2, 2), (3, NULL), (4, 4), (5, NULL);
SET transform_null_in = 1;
SELECT count() FROM null_in_1 WHERE (u, n) IN ((42, NULL));
┌─count()─┐
│ 3 │
└─────────┘
It interprets all rows, where n is NULL as matched, despite the value of u.
CREATE TABLE null_in_1 (a Nullable(UInt32), b Nullable(UInt32)) ENGINE = Memory;
INSERT INTO null_in_1 VALUES (1, NULL) (0, NULL) (NULL, NULL) (NULL, 1) (NULL, 0) (0, 0) (1, 1);
SET transform_null_in = 1;
SELECT count() FROM null_in_1 WHERE (a, b) IN (0, NULL);
┌─count()─┐
│ 3 │
└─────────┘
SELECT count() FROM null_in_1 WHERE (a, b) IN (NULL, 0);
┌─count()─┐
│ 3 │
└─────────┘
SELECT count() FROM null_in_1 WHERE (a, b) IN (0, 0);
┌─count()─┐
│ 3 │
└─────────┘
It doesn't see the difference between default value and null value.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release