Skip to content

Backport #113759 to 26.3: Fix segfault in expandOrderByAll for a Merge child query - #116762

Merged
alexey-milovidov merged 3 commits into
26.3from
backport/26.3/113759
Aug 30, 2026
Merged

alexey-milovidov merged 3 commits into
26.3from
backport/26.3/113759

Conversation

@robot-ch-test-poll4

@robot-ch-test-poll4 robot-ch-test-poll4 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #113759
Cherry-pick pull-request #116328

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.26.4

@robot-ch-test-poll4 robot-ch-test-poll4 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Aug 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [fd0d27e]

Summary: ✅

…`NATURAL JOIN`

`NATURAL JOIN` does not exist on `26.3`, so the backported test
`04817_order_by_all_merge_natural_join` failed with a `SYNTAX_ERROR` at the
`NATURAL` keyword instead of exercising the fix.

`NATURAL JOIN` is equivalent to `JOIN ... USING (<common columns>)`, and the
only common column of the two test tables is `a`, so the queries are rewritten
as `JOIN ... USING (a)`. The reference output is unchanged.

Verified locally with the `26.3` CI binaries of this pull request: the rewritten
test still segfaults in `expandOrderByAll` on a `26.3` build without the fix, and
produces byte-identical output to the existing reference file with the fix.
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 The only red was real, not flaky: 04817_order_by_all_merge_natural_join failed with Code: 62 ... Syntax error: failed at position 76 (NATURAL). NATURAL JOIN is a master-only feature and does not exist on 26.3, so the cherry-picked test could never run here.

Rewrote the test to use the exactly equivalent JOIN ... USING (a) (a is the only common column of the two test tables); the reference file is unchanged. Also merged 26.3 into the branch.

Verified with this pull request's own ARM CI binaries: with the fix the rewritten test produces byte-identical output to the committed reference, and against a 26.3 binary without the fix it still segfaults in expandOrderByAll — so the test keeps reproducing the bug.

@alexey-milovidov
alexey-milovidov merged commit be94cb1 into 26.3 Aug 30, 2026
34 checks passed
@alexey-milovidov
alexey-milovidov deleted the backport/26.3/113759 branch August 30, 2026 07:50
bytehalo-infra added a commit to sentioxyz/ClickHouse that referenced this pull request Sep 25, 2026
CTE/AN/QP: old analyzer: ORDER BY ALL in WINDOW VIEW; INTERPOLATE/WINDOW/LIMIT BY over Merge/Distributed with a join -> crash/exc.
Effect in the production build a394e92: wrong/failing (the upstream test fails on it and passes on official 26.8.8.8; evidence/fix_ci_20260925/upstream_repro/residual/113759.PROD263.txt).
Upstream patch unchanged, with its test(s): 04817_order_by_all_merge_natural_join.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants