opt: fix bug and add setting for InlineAnyProjectSet#161880
Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom Jan 30, 2026
Merged
opt: fix bug and add setting for InlineAnyProjectSet#161880craig[bot] merged 3 commits intocockroachdb:masterfrom
craig[bot] merged 3 commits intocockroachdb:masterfrom
Conversation
The recently introduced InlineAnyProjectSet norm rule has a bug when the input array is NULL - it returns NULL instead of false as the originally matched expression would. The fix is simple - just AND the replacement expression with an IS NOT NULL check. This flips the NULL to false in the problem case only. There is no release note, since the bug didn't make it into any release. Fixes cockroachdb#161871 Release note: None
This commit adds a session setting optimizer_inline_any_unnest_subquery to gate the new optimizer rule InlineAnyProjectSet in case we want to backport. The setting is off by default, and will be switched on in the next commit. Informs cockroachdb#161871 Release note (sql change): Added a session setting to enable/disable the optimizer rule InlineAnyProjectSet. The session setting is optimizer_inline_any_unnest_subquery, and will be on by default in 26.2+.
This commit flips the session variable introduced in the previous commit. Informs cockroachdb#161871 Release note: None
Member
michae2
approved these changes
Jan 27, 2026
Collaborator
michae2
left a comment
There was a problem hiding this comment.
@michae2 reviewed 10 files and all commit messages, and made 1 comment.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball).
Collaborator
Author
|
TFTR! bors r=michae2 |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
opt: fix bug in InlineAnyProjectSet
The recently introduced InlineAnyProjectSet norm rule has a bug when the
input array is NULL - it returns NULL instead of false as the originally
matched expression would. The fix is simple - just AND the replacement
expression with an IS NOT NULL check. This flips the NULL to false in the
problem case only.
There is no release note, since the bug didn't make it into any release.
Fixes #161871
Release note: None
opt: gate new norm rule behind session setting
This commit adds a session setting optimizer_inline_any_unnest_subquery
to gate the new optimizer rule InlineAnyProjectSet in case we want
to backport. The setting is off by default, and will be switched on
in the next commit.
Informs #161871
Release note (sql change): Added a session setting to enable/disable the
optimizer rule InlineAnyProjectSet. The session setting is
optimizer_inline_any_unnest_subquery, and will be on by default in 26.2+.
opt: turn on InlineAnyProjectSet rule by default
This commit flips the session variable introduced in the previous
commit.
Informs #161871
Release note: None