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

colexecbase: fix a recently introduced bug with identity cast #98688

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

yuzefovich
Copy link
Member

This commit fixes a recently introduced bug that can occur when we're randomizing coldata.BatchSize() (which we do in tests). In particular, we capped a global singleton at one batch size value, but later we can change it to a higher value, which could lead to index out of bounds. This is now fixed by always using the max batch size.

Fixes: #98660.

Release note: None

This commit fixes a recently introduced bug that can occur when we're
randomizing `coldata.BatchSize()` (which we do in tests). In particular,
we capped a global singleton at one batch size value, but later we can
change it to a higher value, which could lead to index out of bounds.
This is now fixed by always using the max batch size.

Release note: None
@yuzefovich yuzefovich requested review from mgartner, msirek and a team March 15, 2023 16:16
@blathers-crl
Copy link

blathers-crl bot commented Mar 15, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 15, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 15, 2023

Build succeeded:

@craig craig bot merged commit 3016744 into cockroachdb:master Mar 15, 2023
@yuzefovich yuzefovich deleted the fix-identity-cast branch March 15, 2023 22:42
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.

pkg/sql/colexec/colexecbase/colexecbase_test: TestRandomizedCast failed
3 participants