Skip to content

Conversation

@blathers-crl
Copy link

@blathers-crl blathers-crl bot commented Nov 6, 2025

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 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.


Release justification: Low-risk bug fix.

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.
@blathers-crl blathers-crl bot requested a review from a team as a code owner November 6, 2025 00:17
@blathers-crl blathers-crl bot removed the request for review from a team November 6, 2025 00:17
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-25.4-156962 branch from 01c43c3 to 6dd2e30 Compare November 6, 2025 00:17
@blathers-crl blathers-crl bot requested a review from ZhouXing19 November 6, 2025 00:17
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Nov 6, 2025
@blathers-crl
Copy link
Author

blathers-crl bot commented Nov 6, 2025

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Nov 6, 2025
@blathers-crl blathers-crl bot requested a review from mgartner November 6, 2025 00:17
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Nov 6, 2025
@blathers-crl blathers-crl bot requested a review from yuzefovich November 6, 2025 00:17
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

@yuzefovich reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @ZhouXing19)

Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

Ah, I remember #128123, nice! :lgtm:

@michae2 reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @ZhouXing19)

@mgartner mgartner merged commit 03593e0 into release-25.4 Nov 7, 2025
24 of 25 checks passed
@mgartner mgartner deleted the blathers/backport-release-25.4-156962 branch November 7, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-queries SQL Queries Team target-release-25.4.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants