Repository navigation
More fuzzing in CI - #104207
Merged
Merged
More fuzzing in CI#104207
Conversation
Contributor
|
Workflow [PR], commit [01e63f5] Summary: ✅ AI ReviewSummaryThis PR expands BuzzHouse/query-fuzzer coverage (new Iceberg Findings
ClickHouse Rules
Final Verdict
|
PedroTadim
enabled auto-merge
May 6, 2026 11:25
1 task done
Contributor
LLVM Coverage Report
Changed lines: 0.00% (0/53) | lost baseline coverage: 150 line(s) · Uncovered code |
1 task done
pull Bot
pushed a commit
to Mu-L/ClickHouse
that referenced
this pull request
May 8, 2026
…dst type Issue: ClickHouse#104335 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104207&sha=5d28f866f2fcc95da659a2cf1e71750d60db1b6e&name_0=PR&name_1=Unit%20tests%20%28tsan%2C%20function_prop_fuzzer%29 `caseWithExpression` builds a constant `Array(then_supertype)` for the inner `transform` call out of the THEN values only, where `then_supertype = getLeastSupertype(then_types)` ignores the ELSE-branch type. `transform`'s own return type is `getLeastSupertype(then_supertype, default_type)`, computed at its build time inside `FunctionTransformOverloadResolver::buildImpl`, and it uses that return type to cast `cache->to_column` and `cache->default_column`. Meanwhile `caseWithExpression` calls into `transform` with `result_type` computed by its own `getReturnTypeImpl`, namely `getLeastSupertype([THENs..., default])`. Whenever `getLeastSupertype` of the combined set is narrower than the chained `getLeastSupertype(then_supertype, default)` -- as happens when the THENs and the ELSE land in different `ColumnDecimal` storages -- the two computations disagree. Concrete failure: THENs `(UInt16, Int8)` give a then-only supertype of `Int32`. With ELSE `Decimal(9, 2)`, `getLeastSupertype(Int32, Decimal(9, 2))` is `Decimal(12, 2)` (`Decimal64` storage), but `getLeastSupertype(UInt16, Int8, Decimal(9, 2))` is `Decimal(9, 2)` (`Decimal32` storage). So `cache->to_column` is a `ColumnDecimal<Decimal64>` while `executeNumToNum` is dispatched with `T = ColumnDecimal<Decimal32>` (matching `column_result`), and the `assert_cast<const T *>(cache->to_column.get())` in `transform.cpp` fires a `Bad cast` `LOGICAL_ERROR` and aborts in debug / sanitizer builds. This is what `Unit tests (tsan, function_prop_fuzzer)` hit on PR ClickHouse#104207 and the exact symptom @PedroTadim filed in ClickHouse#104335. Fix: include `args.back().type` (the ELSE branch type) in the supertype computation that produces `dst_supertype`, so the dst array we hand to `transform` is wide enough that `getLeastSupertype(dst_supertype, default_type)` collapses to our `result_type`. The existing `tryGetLeastSupertype` / `can_use_transform` guards already cover the case where no common supertype exists. The new regression test exercises the minimised case, the original fuzzer query, plus `Decimal(38, 4)` and `Float64` ELSE variants. It uses `clickhouse-local` because the server-side analyzer constant-folds the all-constant expression before reaching `transform`; `clickhouse-local` preserves the same code path the unit-test fuzzer hit. Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 task done
1 task
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Add newest settings to BuzzHouse.
Update server configuration file by removing obsolete settings,
Add new ALTER statements for Iceberg tables.
System statements.
More swappable functions and aggregates in AST fuzzer.
Fuzz time related settings in BuzzHouse with
enable_time_settingsoption sometimes in CI.Documentation is written (mandatory for new features)
Version info
26.5.1.440