Repository navigation
Add test: fieldToNumber<bool> out-of-range Float64 branch in SettingsFields.cpp untested - #104476
Conversation
72e43fa to
1efee1d
Compare
|
Reviewed this PR — it fills a real coverage gap from #104154. Approving. Coverage gap verification: Legitimate. The merged #104154 added an Test logic verification: All cases trace through
Local repro: Nits (non-blocking):
Label: I'd add |
|
Workflow [PR], commit [1efee1d] Summary: ✅ AI ReviewSummaryThis PR adds a focused stateless SQL test for the ClickHouse Rules
Final Verdict
|
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #104154.
That PR This PR fixes undefined behavior in
FieldVisitorConvertToNumber<T>::operator()(Float64)andfieldToNumber<T>for wide integer types (UInt64, Int64, Int128, etc.) when the input Float64 is at the 2^64 boundary. The old code usedx > Float64(numeric_limits<T>::max())which failed for wide intege1.
fieldToNumber<bool>out-of-range Float64 branch inSettingsFields.cppuntestedsrc/Core/SettingsFields.cpp:129Risk:
fieldToNumber<bool>at SettingsFields.cpp:127-130 branches onstd::is_same_v<T, bool>to use naive comparison instead ofaccurate::lessOp(which won't compile for bool). Call chain: `SettingFielWhat's unique vs PR tests: PR's test 04205_field_visitor_convert_to_number_ubsan_103817.sql tests the UInt64 boundary (1.8446744073709552e19) for aggregate functions and settings. My test covers the BOOL special case branch whi
Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes