Repository navigation
Analyzer: fix FINAL leaking onto other tables of a JOIN - #108979
Conversation
|
Workflow [PR], commit [3103ca6] Summary: ✅
AI ReviewSummaryThis PR fixes the analyzer so Final VerdictStatus: ✅ Approve |
|
@groeneai create repro for Unit tests (asan_ubsan, function_prop_fuzzer) failure and check out other ones |
|
@vdimir Triaged all 4 reds on 1. Unit tests (asan_ubsan, function_prop_fuzzer) -> FunctionsStress.stress / AllTests The failing fuzzer query is Deterministic repro (validated in #108878): SELECT reinterpret(a, CAST('Decimal128(2)' AS String))
FROM system.one
ARRAY JOIN CAST([0.0816, 1036.36, -0.0200, 0.00265] AS Array(Decimal(38, 33))) AS a;Root cause: Not PR-caused: the same shape hit master 8x and 52 distinct PRs on 2026-06-30 (the day this ran). Fix: #108878 (ours, open) rebuilds the column at the target scale; its regression unit test fails without the fix and passes with it. 2 & 3. Stress test (amd_tsan / arm_tsan) -> "Hung check failed, possible deadlock found" Chronic hung-check family, issue #107941 (~490 hits / ~170 distinct PRs / 49 on master on 2026-06-30 alone). Fixing PRs: #108212 (merged) and #105905 (open). 4. BuzzHouse (amd_tsan) -> ThreadSanitizer: data race (STID 2604-385d) Race copying the live query Context during RESTORE: |
novikd
left a comment
There was a problem hiding this comment.
The idea for a fix makes sense, but corner cases should be handled correctly.
6bef6db to
3103ca6
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 13/20 (65.00%) · Uncovered code |
Backport #108979 to 26.6: Analyzer: fix FINAL leaking onto other tables of a JOIN
|
I'm wrapping this logic in the setting
|
PR ClickHouse#108979 fixed FINAL on the left-most table of a JOIN leaking onto the other joined tables. The fix is result-changing for queries over ReplacingMergeTree tables with unmerged duplicate rows that relied on the old behavior, and had no compatibility gate. Put the legacy behavior under the new setting and register it in SettingsChangesHistory so that compatibility with versions before 26.7 restores the old semantics.
PR ClickHouse#108979 fixed FINAL on the left-most table of a JOIN leaking onto the other joined tables. The fix is result-changing for queries over ReplacingMergeTree tables with unmerged duplicate rows that relied on the old behavior, and had no compatibility gate. Put the legacy behavior under the new setting and register it in SettingsChangesHistory so that compatibility with versions before 26.7 restores the old semantics.
…zer-final-join-prewhere-pushdown Analyzer: fix FINAL leaking onto other tables of a JOIN
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
FROM t1 FINAL JOIN t2) was incorrectly applied to the other joined tables as well, what could made such queries slower.Version info
26.7.1.719(included in26.7and later)26.6.2.56