Skip to content

Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table - #131055

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:mongodb-old-analyzer
Nov 13, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:mongodb-old-analyzer

Conversation

@azat

@azat azat commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

The schema query of format_schema_source='query' always used the old analyzer regardless of enable_analyzer, which leaves query_tree empty, while StorageMongoDB checked the setting rather than the pointer.

Note, the crash has been fixed in 26.10+, after partial remove of old analyzer. So this is created only for backports.

Changelog category (leave one):

  • Not for changelog

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table


Workflow [PR]
Sync PR [sync-upstream/pr/131055]

Version info

  • Merged into: 26.11.1.2160-master (included in 26.11 and later)
  • Backported to: 26.10.4.201, 26.9.38.8, 26.8.46.5

@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2f1c77b]

Summary: ✅


AI Review

Summary

The PR guards the missing query tree in StorageMongoDB, returning NOT_IMPLEMENTED by default or reading without pushdown when mongodb_throw_on_unsupported_query=0. This is a focused backport fix for the older schema-query interpreter; current master already uses the analyzer. No actionable findings. The added stateless test passes repeatedly in targeted ASan/UBSan CI.

Missing context / blind spots
  • ⚠️ The 26.6 execution path was checked against its source, but no before/after runtime result for that backport was available. Current-master CI cannot exercise the original null-tree path; running the reproducer against unpatched and patched 26.6 would close this gap.
Final Verdict

Status: ✅ Approve. No changes required to this PR; validate the regression on the backport branch.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Nov 12, 2026
@azat
azat force-pushed the mongodb-old-analyzer branch from 09ef86f to 058761c Compare November 12, 2026 13:25
@clickhouse-gh clickhouse-gh Bot added the comp-foreign-db Connectivity to external databases (ODBC/JDBC, MySQL, PostgreSQL, etc.). label Nov 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 2f1c77be6 with master fc8a49186 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.64, programs/clickhouse-keeper ×0.67 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 6.2 s 10.9 s +6.9 s (+173%)
programs/clickhouse _ZN6detail10static_forITk7is_enumN2DB23AttributeUnderlyingTypeEZNS1_29callOnDictionaryAttributeType… 3.6 s 7.6 s +5.2 s (+226%)
Compile time of recompiled translation units

7 translation units recompiled, 14 s compile time in total, 7 of them have a recent master baseline.

Job report

@vdimir vdimir self-assigned this Nov 12, 2026
The schema query of `format_schema_source='query'` always used the old analyzer
regardless of `enable_analyzer`, which leaves `query_tree` empty, while
`StorageMongoDB` checked the setting rather than the pointer.

Note, the crash has been fixed in 26.10+, after partial remove of old
analyzer. So this is created only for backports.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@azat
azat force-pushed the mongodb-old-analyzer branch from 058761c to 2f1c77b Compare November 12, 2026 15:53
@azat azat added pr-not-for-changelog This PR should not be mentioned in the changelog and removed pr-bugfix Pull request with bugfix, not backported by default labels Nov 12, 2026
@azat
azat added this pull request to the merge queue Nov 13, 2026
Merged via the queue into ClickHouse:master with commit c4b5c38 Nov 13, 2026
401 of 402 checks passed
@azat
azat deleted the mongodb-old-analyzer branch November 13, 2026 08:40
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 13, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 13, 2026
robot-ch-test-poll3 added a commit that referenced this pull request Nov 13, 2026
Cherry pick #131055 to 26.8: Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table
robot-clickhouse added a commit that referenced this pull request Nov 13, 2026
robot-ch-test-poll3 added a commit that referenced this pull request Nov 13, 2026
Cherry pick #131055 to 26.9: Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table
robot-clickhouse added a commit that referenced this pull request Nov 13, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 13, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 13, 2026
Backport #131055 to 26.10: Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table
azat pushed a commit that referenced this pull request Nov 24, 2026
azat pushed a commit that referenced this pull request Nov 24, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 24, 2026
Backport #131055 to 26.8: Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table
clickhouse-gh Bot added a commit that referenced this pull request Nov 24, 2026
Backport #131055 to 26.9: Fix SIGSEGV (in <26.10) when format_schema query reads a MongoDB table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-foreign-db Connectivity to external databases (ODBC/JDBC, MySQL, PostgreSQL, etc.). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v26.6-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants