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

release-2.1: sql: fix evaluation of <tuple> IS NULL #30184

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

rytaft
Copy link
Collaborator

@rytaft rytaft commented Sep 13, 2018

Backport 1/3 commits from #30022.

/cc @cockroachdb/release


Prior to this patch, the comparison op overload for the
IsNotDistinctFrom operation with tuple inputs had NullableArgs
incorrectly set to false. As a result, the output was incorrect
for queries such as:

SELECT (1, 2, 3) IS NULL

This query should return false, but instead it returned NULL.
This commit fixes this bug.

Release note (bug fix): Fixed the evaluation of IS NOT NULL and
IS NULL comparison operations involving a non-null constant tuple
to return true or false rather than NULL.

Prior to this patch, the comparison op overload for the
IsNotDistinctFrom operation with tuple inputs had NullableArgs
incorrectly set to false. As a result, the output was incorrect
for queries such as:

SELECT (1, 2, 3) IS NULL

This query should return false, but instead it returned NULL.
This commit fixes this bug.

Release note (bug fix): Fixed the evaluation of <tuple> IS NOT NULL and
<tuple> IS NULL comparison operations involving a non-null constant tuple
to return true or false rather than NULL.
@rytaft rytaft requested review from RaduBerinde, andy-kimball and a team September 13, 2018 10:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rytaft
Copy link
Collaborator Author

rytaft commented Sep 13, 2018

Backporting all of #30022 together was causing issues (this commit needs to be ordered first, but was created after the other two), so I'm backporting this commit first, then will do the other two.

Copy link
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@rytaft rytaft merged commit 9246614 into cockroachdb:release-2.1 Sep 13, 2018
@rytaft rytaft deleted the backport2.1-30022 branch September 13, 2018 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants