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

explain: fix overflow when printing estimated row count #118970

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

yuzefovich
Copy link
Member

Previously, when the optimizer estimated a very large row count (which is float64), we would first cast it to uint64 (which would work ok in case the count is large - we'd get max int64 + 1), and then we would cast it to int64 which can result in a negative number. This is now fixed by adding a check before casting to int64 to cap the value at max int64.

Epic: None

Release note: None

Previously, when the optimizer estimated a very large row count (which
is float64), we would first cast it to uint64 (which would work ok in
case the count is large - we'd get `max int64 + 1`), and then we would
cast it to int64 which can result in a negative number. This is now
fixed by adding a check before casting to int64 to cap the value at max
int64.

Epic: None

Release note: None
@yuzefovich yuzefovich requested a review from a team as a code owner February 8, 2024 19:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

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

:lgtm:

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

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 8, 2024

Build succeeded:

@craig craig bot merged commit 3671865 into cockroachdb:master Feb 8, 2024
7 of 9 checks passed
@yuzefovich yuzefovich deleted the fix-explain-overflow branch February 8, 2024 23:00
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.

3 participants