Skip to content

opt: check for nulls before attempting to fold binary operators#89047

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
DrewKimball:fold-nulls
Oct 2, 2022
Merged

opt: check for nulls before attempting to fold binary operators#89047
craig[bot] merged 1 commit intocockroachdb:masterfrom
DrewKimball:fold-nulls

Conversation

@DrewKimball
Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball commented Sep 30, 2022

This commit adds a check before the call to eval.BinaryOp to ensure that the operands are non-null before attempting to fold a plus or minus expression. This prevents a panic that would occur down the stack due to a type assertion that doesn't expect NULL values.

Fixes #89024

Release note: None

@DrewKimball DrewKimball requested a review from a team as a code owner September 30, 2022 02:36
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm: Thanks! This will need to be backported along with #88970 and #88971 (cc @mgartner)

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)


-- commits line 7 at r1:
nit: expecte -> expect

Copy link
Copy Markdown
Collaborator Author

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)


-- commits line 7 at r1:

Previously, rytaft (Rebecca Taft) wrote…

nit: expecte -> expect

Done.

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)


-- commits line 7 at r1:

Previously, DrewKimball (Drew Kimball) wrote…

Done.

now you've got a different typo :) expected -> expect

This commit adds a check before the call to `eval.BinaryOp` to ensure
that the operands are non-null before attempting to fold a plus or minus
expression. This prevents a panic that would occur down the stack due to
a type assertion that doesn't expect NULL values.

Fixes cockroachdb#89024

Release note: None
Copy link
Copy Markdown
Collaborator Author

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)


-- commits line 7 at r1:

Previously, rytaft (Rebecca Taft) wrote…

now you've got a different typo :) expected -> expect

Agh, thanks. Done.

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)

@DrewKimball
Copy link
Copy Markdown
Collaborator Author

Failures look unrelated. TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 2, 2022

Build failed:

@DrewKimball
Copy link
Copy Markdown
Collaborator Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 2, 2022

Build succeeded:

@mgartner
Copy link
Copy Markdown
Contributor

mgartner commented Oct 4, 2022

Thanks for fixing this!

@DrewKimball
Copy link
Copy Markdown
Collaborator Author

blathers backport 22.2.0

@DrewKimball
Copy link
Copy Markdown
Collaborator Author

blathers backport 22.1 21.2

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Oct 7, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 51c608a to blathers/backport-release-22.1-89047: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.1 failed. See errors above.


error creating merge commit from 51c608a to blathers/backport-release-21.2-89047: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.2 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

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.

roachtest: error: interface conversion: tree.Datum is tree.dNull, not *tree.DTime

4 participants