Skip to content

Fix parameterized view insert select legacy interpreter - #119495

Merged
yariks5s merged 6 commits into
masterfrom
yarik/fix-parameterized-view-insert-select-legacy-interpreter
Sep 17, 2026
Merged

yariks5s merged 6 commits into
masterfrom
yarik/fix-parameterized-view-insert-select-legacy-interpreter

Conversation

@yariks5s

@yariks5s yariks5s commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fix UNKNOWN_IDENTIFIER errors in INSERT ... SELECT from a parameterized view when parallel_distributed_insert_select is enabled. the view was analyzed with the legacy interpreter even though the analyzer was enabled.


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

Version info

  • Merged into: 26.10.1.62 (included in 26.10 and later)
  • Backported to: 26.9.1.1603, 26.8.7.19, 26.7.12.3

@clickhouse-gh

clickhouse-gh Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2166b1f]

Summary: ✅


AI Review

Summary

This PR fixes the parameterized-view INSERT ... SELECT header mismatch by making Context::executeTableFunction pick the sample-block interpreter from the caller's analyzer mode, and it adds a stateless regression for the default view-security path. The code change itself looks right, but the proof is still incomplete because the new test does not exercise the SQL SECURITY override branch that made the caller-vs-view-context choice necessary.

Missing context / blind spots
  • ⚠️ The only CI report available from the linked Praktika run on 2026-09-17 was Build profile diff; I could not confirm from CI that the new stateless regression was executed.
Tests
  • ⚠️ [tests/queries/0_stateless/05182_parameterized_view_insert_select_parallel_distributed.sql:8] The new regression creates a default-security view, so getSQLSecurityOverriddenContext does not rebuild a divergent context there. As a result, the test would still pass on the earlier broken view_context->getSettingsRef()[Setting::allow_experimental_analyzer] implementation. Please add the smallest regression that forces the caller and overridden view context to disagree, such as a config-backed SQL SECURITY DEFINER or SQL SECURITY NONE case.
Final Verdict

Status: ⚠️ Request changes
Minimum required actions: add a regression that exercises the explicit SQL SECURITY path where the caller context and overridden view context can diverge.

LLVM Coverage Report

Measured on commit 2166b1f.

Metric Baseline Current Δ
Lines 88.40% 88.50% +0.10%
Functions 91.70% 91.70% +0.00%
Branches 80.70% 80.70% +0.00%

Changed lines: Changed C/C++ lines covered: 6/6 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Sep 11, 2026
Comment thread src/Interpreters/Context.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-view Logical (non-materialized) views. label Sep 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 2166b1fd6 with master 2d19d1b6e (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.

Compile time of recompiled translation units

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

Job report

@yariks5s
yariks5s added this pull request to the merge queue Sep 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 17, 2026
…analyzer since v26.9, so the scenario cannot be built
@yariks5s
yariks5s enabled auto-merge September 17, 2026 16:30
@yariks5s
yariks5s disabled auto-merge September 17, 2026 19:24
@yariks5s
yariks5s added this pull request to the merge queue Sep 17, 2026
Merged via the queue into master with commit cb505f9 Sep 17, 2026
349 of 350 checks passed
@yariks5s
yariks5s deleted the yarik/fix-parameterized-view-insert-select-legacy-interpreter branch September 17, 2026 21:55
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 17, 2026
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 17, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 18, 2026
Backport #119495 to 26.9: Fix parameterized view insert select legacy interpreter
clickhouse-gh Bot pushed a commit that referenced this pull request Sep 18, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 18, 2026
Backport #119495 to 26.8: Fix parameterized view insert select legacy interpreter
robot-clickhouse-ci-2 added a commit that referenced this pull request Sep 18, 2026
Cherry pick #119495 to 26.6: Fix parameterized view insert select legacy interpreter
robot-clickhouse added a commit that referenced this pull request Sep 18, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Sep 18, 2026
Cherry pick #119495 to 26.7: Fix parameterized view insert select legacy interpreter
robot-clickhouse added a commit that referenced this pull request Sep 18, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 18, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 18, 2026
Backport #119495 to 26.7: Fix parameterized view insert select legacy interpreter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-view Logical (non-materialized) views. pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.4-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants