Repository navigation
Add test: Out-of-range index throw in refactored vectorConstant (non-const haystack + const index) is untested - #106819
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [92d42b3] Summary: ✅ AI ReviewSummaryThis test-only PR adds focused stateless coverage for Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 395 line(s), 25 function(s) across 126 file(s) · Details Top files
|
|
LGTM. Verified the coverage gap is real. Dispatch in
Ran the queries on a 26.6 debug build: output matches the committed Test is correct and the |
ba3e30d
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 #106374.
That PR (1) The PR makes
regexpExtract(haystack, pattern)(two-arg form) default the group index to0(whole match) whenpatternhas no capturing group, instead of1(which was out-of-range and threwINDEX_OF_POSITIONAL_ARGUMENT_IS_OUT_OF_RANGE). The change is localized tovectorConstant, whose1. Out-of-range index throw in refactored
vectorConstant(non-const haystack + const index) is untestedsrc/Functions/regexpExtract.cpp:144Risk: Call chain:
executeImpl(line 96, non-const haystack + const index,isColumnConsttrue) ->vectorConstant->index = index_arg.value_or(...)(line 143, refactored) ->if (index < 0 || index >= capture + 1) throw(line 144). The PR refactored exactly this function but its out-of-range test uses a const haystack, whichuseDefaultImplementationForConstantsfolds into thevectorVectorpath instead. RISK: if the refactor regressed the bounds check, an explicit out-of-range index on …What's unique vs PR tests: The PR's out-of-range assertion
regexpExtract('100-200', '\d+', 1)uses a const haystack, whichuseDefaultImplementationForConstantsfolds into thevectorVectorpath (throw at line 196). This test uses a materialized (non-const) haystack with a const index, the only input shape that reaches thevectorConstantthrow at lines 144-146 — the function the PR actually refactored — which the LLVM report confirms is otherwise uncovered.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