fix(query): avoid panic on UInt64 full-range scan stats (#19555)#19631
Closed
sundy-li wants to merge 3 commits intodatabendlabs:mainfrom
Closed
fix(query): avoid panic on UInt64 full-range scan stats (#19555)#19631sundy-li wants to merge 3 commits intodatabendlabs:mainfrom
sundy-li wants to merge 3 commits intodatabendlabs:mainfrom
Conversation
# Conflicts: # tests/sqllogictests/suites/base/issues/issue_19555.test
Member
Author
|
Closing this PR because the same fix was already merged via #19632 on 2026-03-30. As a result, this branch now has no net diff against main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
UInt64full-range overflow whenScan::derive_statsreduces NDV from min/max column statistics[0, u64::MAX]stats instead of panicking during scan stats derivationUInt64table caseFixes #19555
Implementation
scan.rsmax - min + 1does not overflow on the fullUInt64rangeTests
Validation run locally:
CARGO_HOME=/workspace/databend/.worktrees/pr-fix-19555/.cargo-home CARGO_TARGET_DIR=/workspace/databend/.worktrees/pr-fix-19555/.cargo-target cargo test -p databend-common-sql test_reduce_ndv_by_uint_full_range_saturatesCARGO_HOME=/workspace/databend/.worktrees/pr-fix-19555/.cargo-home CARGO_TARGET_DIR=/workspace/databend/.worktrees/pr-fix-19555/.cargo-target cargo clippy -p databend-common-sql --tests -- -D warningsAdded but not executed locally:
tests/sqllogictests/suites/base/issues/issue_19555.testType of change
This change is