Repository navigation
Fix variant_throw_on_type_mismatch/dynamic_throw_on_type_mismatch=false not catching exceptions during function execution - #105543
Conversation
…ring `execute` The `try_build` lambda in `FunctionVariantAdaptor` and `FunctionDynamicAdaptor` only wrapped `build()` in a try-catch for type-related errors. Some functions (e.g. comparison functions like `equals`) pass `build()` successfully but throw `NO_COMMON_TYPE` during `execute()` because `executeGeneric` calls `getLeastSupertype` which rejects incompatible types like `String` and `UInt8`. Add a `try_execute` helper that wraps `execute()` calls with the same try-catch pattern, returning NULL for incompatible-type rows when `throw_on_type_mismatch` is disabled. Apply the fix to all three execution paths in both adaptors (single variant no NULLs, single variant with NULLs, and the general multi-variant case). Closes #103484 Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [41b943b] Summary: ❌
AI ReviewSummary
Final Verdict
|
The try_execute lambda in both FunctionVariantAdaptor and FunctionDynamicAdaptor was catching ILLEGAL_TYPE_OF_ARGUMENT, TYPE_MISMATCH, and CANNOT_CONVERT_TYPE in addition to NO_COMMON_TYPE. This was too broad: functions like geoToS2 throw ILLEGAL_TYPE_OF_ARGUMENT during execute() for value-dependent reasons (NaN/infinite coordinates), not because of a type incompatibility. With variant_throw_on_type_mismatch=false, these legitimate execution failures were silently converted to NULL. The fix narrows try_execute to only suppress NO_COMMON_TYPE, which is the specific error getLeastSupertype throws in executeGeneric when the alternative type is incompatible with the other argument (e.g. comparison functions). All other errors now propagate correctly even with throw_on_type_mismatch=false. try_build is unchanged — it still catches the full set of type-related errors, as build() failures for incompatible types are always legitimate to suppress. Add regression test (requires s2): 04264_variant_throw_on_type_mismatch_value_error Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 66/73 (90.41%) | Lost baseline coverage: none · Uncovered code |
|
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment. TL;DRFix ClickGap verified: reproduced it with the script below on ReproductionBisect
Affects
Suggested next stepThe bisect boundary above narrows the search in Component: cc fix PR author: @Avogar ClickGap · Finding: Triage metadata
|
Closes #103484
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
variant_throw_on_type_mismatch/dynamic_throw_on_type_mismatch=falsenot catching exceptions during function execution. Closes #103484Version info
26.6.1.510