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

opt: don't fold sub-operators with null operands during type check #97948

Merged
merged 1 commit into from
Mar 7, 2023

Commits on Mar 7, 2023

  1. opt: don't fold sub-operators with null operands during type check

    This commit prevents type-checking from replacing expressions like
    `NULL = ANY(...)` with `NULL`. This is necessary because in the case when
    the right operand is an empty array, the result of the expression is
    `False` instead of `NULL`. It is not always possible to know what the
    right operand will evaluate to, and constant folding can be handled
    during normalization anyway.
    
    Fixes cockroachdb#37793
    
    Release note (bug fix): Fixed a long-standing and rare bug in evaluation
    of `ANY`, `SOME`, and `ALL` sub-operators that would cause expressions like
    `NULL = ANY(ARRAY[]::INT[])` to return `NULL` instead of `False`.
    DrewKimball committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    35cab4c View commit details
    Browse the repository at this point in the history