Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use FieldExistsQuery over REF that is arg of NON_NULLABLE function #15280

Merged
merged 1 commit into from
Jan 10, 2024

Commits on Jan 10, 2024

  1. Do not filter nulls from fields that are arguments of NON_NULLABLE fu…

    …nctions
    
    cr> create table t (a int, b int);
    CREATE OK, 1 row affected (0.210 sec)
    cr> insert into t values (null, null), (null, 2), (2, null), (2, 2);
    INSERT OK, 4 rows affected (0.032 sec)
    
    cr> select * from t where a != (b||1);
    +---+---+
    | a | b |
    +---+---+
    | 2 | 2 |  --> missing a row, see below
    +---+---+
    SELECT 1 row in set (0.022 sec)
    
    cr> select a, b, a != (b||1) from t;
    +------+------+----------------------------+
    |    a |    b | (NOT (a = concat(b, '1'))) |
    +------+------+----------------------------+
    | NULL |    2 | NULL                       |
    | NULL | NULL | NULL                       |
    |    2 | NULL | TRUE                       | --> this row is missing from the result of the query above
    |    2 |    2 | TRUE                       |     because of an unwanted FieldExistsQuery over field 'b'
    +------+------+----------------------------+
    SELECT 4 rows in set (0.023 sec)
    jeeminso committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    eadaded View commit details
    Browse the repository at this point in the history