-
Notifications
You must be signed in to change notification settings - Fork 4k
release-25.2: colexec: fix projections with constant NULL values #156977
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
Conversation
This commit fixes a bug in the vectorized engine that caused internal errors when projections operated on constant NULL values. The proj_const_right_ops operators do not correctly handle NULL inputs. So, we avoid these code paths when operator does not operate on NULL values and the LHS or RHS of an operator is NULL by simply projecting NULLs. This is similar to the change made in #128123 and addresses a TODO added in that PR. This code path is unlikely to hit (maybe impossible) without generic query plans. In an optimized cusotm plan, the optimizer will fold expressions with `NULL` values at optimization time, and the execution engine will never see expressions of this form. Fixes #152771 Release note (bug fix): A bug has been fixed that could cause internal errors for queries using generic query plans with `NULL` placeholder values.
|
Thanks for opening a backport. Before merging, please confirm that it falls into one of the following categories (select one):
Add a brief release justification to the PR description explaining your selection. Also, confirm that the change does not break backward compatibility and complies with all aspects of the backport policy. All backports must be reviewed by the TL and EM for the owning area. |
yuzefovich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably doesn't qualify for backport to 25.2, will defer to @michae2 on this one.
@yuzefovich reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @michae2)
|
✅ PR #156977 is compliant with backport policy Confidence: high
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Ya, maybe not. There are risks on both sides. Hitting this is much more likely in v25.2 which enabled generic query plans by default. If we do not backport, then we risk workloads hitting this internal error—and it will be hit sporadically depending on the arguments and whether or not a generic query plan is selected. That being said, one could argue that passing If we backport, there is some chance that this change is incorrect or dangerous (or unlocks other incorrect or dangerous code paths). In the worst case we'd see incorrect results or nodes panic. It's difficult to quantify this risk. |
michae2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with blather's analysis. I think we can consider this a serious issue, because it becomes much more likely in 25.2 with generic query plans. Spurious query failures after upgrade to 25.2 would be an escalation to us. So I don't think we need an ENGREQ for this. And I think this qualifies for the feature flag exception because it's < 5 loc and no customer would consider it a breaking change.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
|
(Just to be clear, I have no concerns whatsoever about the risk of this change, and if it was up to me, I'd backport this without reservations. My comment was mostly about having enough justification given the stricter backport policy. 😉 ) |
Backport 1/1 commits from #156962 on behalf of @mgartner.
This commit fixes a bug in the vectorized engine that caused internal
errors when projections operated on constant NULL values. The
proj_const_right_ops operators do not correctly handle NULL inputs. So,
we avoid these code paths when operator does not operate on NULL values
and the LHS or RHS of an operator is NULL by simply projecting NULLs.
This is similar to the change made in #128123 and addresses a TODO added
in that PR.
This code path is unlikely to hit (maybe impossible) without generic
query plans. In an optimized cusotm plan, the optimizer will fold
expressions with
NULLvalues at optimization time, and the executionengine will never see expressions of this form.
Fixes #152771
Release note (bug fix): A bug has been fixed that could cause internal
errors for queries using generic query plans with
NULLplaceholdervalues.
Release justification: Low-risk bug fix.