Skip to content

Enforce TABLE ENGINE grant in table functions - #109331

Merged
antonio2368 merged 5 commits into
ClickHouse:masterfrom
groeneai:fix-table-function-engine-grant
Sep 3, 2026
Merged

antonio2368 merged 5 commits into
ClickHouse:masterfrom
groeneai:fix-table-function-engine-grant

Conversation

@groeneai

@groeneai groeneai commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator

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):

Fixed a privilege-escalation gap where the executable table function did not enforce the TABLE ENGINE ON Executable grant. With table_engines_require_grant enabled, a user denied CREATE TABLE ... ENGINE = Executable could still run the same server-side script via SELECT ... FROM executable(...). It now requires GRANT TABLE ENGINE ON Executable, matching CREATE TABLE.

Description

executable runs a server-side script under the ClickHouse OS user. Table functions checked only source access (READ/WRITE ON S3/URL/...) and CREATE TEMPORARY TABLE, never the TABLE ENGINE grant CREATE TABLE enforces via InterpreterCreateQuery. So with table_engines_require_grant = true, a user without GRANT TABLE ENGINE ON Executable was correctly denied CREATE TABLE ... ENGINE = Executable(...) but could still reach the same StorageExecutable capability via SELECT * FROM executable('sh -c ...', ...).

Bounded, not RCE: needs table_engines_require_grant = true plus a pre-existing executable under user_scripts_path, and runs as the ClickHouse OS user; not exploitable on Cloud (setting force-disabled, no write primitive there). It is a prerequisite for enabling the setting, which otherwise denies ENGINE = Executable while leaving executable open.

Fix. New ITableFunction::checkEngineAccess, called from both execute and getActualTableStructureWithAccess, so SELECT, DESCRIBE and CREATE TABLE AS are gated when the table function is named directly. It is scoped by a new opt-in virtual requiresTableEngineGrant, true only on TableFunctionExecutable (engine Executable), and is a no-op when the setting is off.

Deliberately not gated: wrapper/proxy engines (merge, loop, dictionary, view, remote), already gated by delegated data access (SELECT/SHOW COLUMNS on the wrapped table, dictionary access, row policies) - gating them would be a new requirement and breaks 03680_loop_table_function_access_check, 04411_loop_table_function_describe_access_check, 03928_loop_row_policy and 03273_dictionary_rbac; pseudo-engines (numbers, values), which have no storage engine; and source functions (s3, url, file), gated on the source axis by the filter-aware checkSourceAccess.

One structure-only path deliberately left out of scope (viewIfPermitted)

One structure-only path is out of scope: viewIfPermitted resolves its ELSE branch through the fallback's raw getActualTableStructure (TableFunctionViewIfPermitted.cpp:92-95), so DESCRIBE viewIfPermitted(... ELSE executable(...)) answers without the grant check. It discloses nothing (executable takes its structure as an explicit literal argument, so the answer is what the caller typed) and never reaches the script - execution goes via else_table_function->execute, which does check, so nested SELECT and CREATE TABLE ... AS SELECT are denied. That path bypasses master's own checkSourceAccess identically, verified against a pristine-master build, so it is pre-existing and belongs in its own PR.

Tests in tests/integration/test_grant_and_revoke/test_with_table_engine_grant.py: executable SELECT/DESCRIBE denied without the grant, allowed with it, plus a regression asserting wrapper (null, merge), pseudo (numbers, values) and source (url with a source grant) table functions stay ungated on TABLE ENGINE.


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

Version info

  • Merged into: 26.9.1.585 (included in 26.9 and later)
  • Backported to: 26.8.3.22, 26.7.7.20, 26.6.5.40, 26.3.30.11

@groeneai

groeneai commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Server with table_engines_require_grant=true; user with GRANT CREATE TABLE ON db.* but no GRANT TABLE ENGINE ON Executable. CREATE TABLE ... ENGINE=Executable(...) -> Code 497 (denied), but SELECT * FROM executable('sh -c id','TabSeparated','x String') succeeded and ran the script. Reproduced on debug build ba606da.
b Root cause explained? ITableFunction::execute() / getActualTableStructureWithAccess() called only checkSourceAccess() (no-op for engines with source_access_type=nullopt, i.e. Executable) + checkAccess(CREATE_TEMPORARY_TABLE). They never checked AccessType::TABLE_ENGINE, which is the grant CREATE TABLE enforces via InterpreterCreateQuery. So the persistent path was gated and the table-function path was not, for the same underlying storage capability.
c Fix matches root cause? Yes. New checkEngineAccess() adds the missing checkAccess(TABLE_ENGINE, engine) on both entry points (SELECT/DESCRIBE/CREATE TABLE AS), directly closing the axis that was unchecked.
d Test intent preserved / new tests added? New tests added; no existing test weakened. test_table_function_engine_grant (deny without grant on SELECT+DESCRIBE, allow with grant, null() gated) and test_table_function_engine_grant_does_not_regress_pseudo_and_source (regression guard for pseudo + source functions).
e Demonstrated in both directions? Yes. Without fix: SELECT FROM executable(...) ran the script. With fix: denied with TABLE ENGINE ON Executable; granting the engine makes it pass access (then fails on the missing script, not on access).
f Fix general, not a narrow patch? Yes. Fix is in the shared base ITableFunction, so it covers every table function through one gate (no TF overrides execute()). Gates the full non-source engine class: Executable, ExecutablePool, Merge, Null, View, Distributed, Dictionary, Loop, GenerateRandom, FuzzQuery, FuzzJSON. Verified Executable/ExecutablePool/Merge/Null all denied without grant.
g Generalizes across inputs / wrappers? Yes. Handled both engine-name shapes: normal (getStorageEngineName) and cluster (getNonClusteredStorageEngineName, e.g. FileCluster->File, URLCluster->URL). Empty pseudo-engine names skipped; source engines skipped. Verified numbers()/values()/zeros() (pseudo) and url()/file()/s3() (source) unaffected.
h Backward compatible? Yes. No-op when table_engines_require_grant=false (the access layer already implicitly grants all non-source engines in that mode). Only changes behavior under the opt-in setting, tightening it to match CREATE TABLE. No format/setting-default change; SettingsChangesHistory.cpp N/A.
i Invariants / contracts preserved? Yes. Mirrors the ContextAccess source<->TABLE_ENGINE sync model exactly (ContextAccess.cpp:274-287): source engines bridged via source grant (filter-aware checkSourceAccess, untouched), non-source engines gated on TABLE_ENGINE. Reuses the existing getSourceAccessObject() member, adding no new StorageFactory lookup/throw surface beyond what checkSourceAccess already performs on every execute().

Session id: cron:clickhouse-worker-slot-6:20260703-155200

@groeneai

groeneai commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

cc @vitlibar @pufit — could you review this? It closes a TABLE ENGINE grant bypass: with table_engines_require_grant=true, SELECT/DESCRIBE over a non-source-engine table function (e.g. executable()) skipped the AccessType::TABLE_ENGINE check that CREATE TABLE ... ENGINE=Executable enforces. New ITableFunction::checkEngineAccess() gates only non-source, non-empty engines, mirroring the ContextAccess source<->TABLE_ENGINE sync model (source functions and pseudo-engines unaffected).

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jul 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b7b9c3c]

Summary: ❌

job_name test_name status info comment
LLVM Coverage FAIL
Generate LLVM Coverage Diff Report FAIL cidb
Print Uncovered Code FAIL cidb Uncovered code analysis did not run: bash ci/jobs/scripts/generate_diff_coverage_report.sh failed (its output is on the Generate LLVM Coverage Diff Report result).
Parser memory check ERROR
Resolve master binary ERROR

AI Review

Summary

This PR closes the direct executable() TABLE ENGINE grant bypass by checking AccessType::TABLE_ENGINE from both ITableFunction::execute and getActualTableStructureWithAccess. However, the hardening is still incomplete: viewIfPermitted continues to resolve its fallback through raw getActualTableStructure, so a nested source-backed fallback can still do schema inference and outbound access on a structure-only path without the source grant. I cannot approve it until that remaining bypass is closed or explicitly rejected on that path.

Findings
❌ Blockers
  • [src/TableFunctions/TableFunctionViewIfPermitted.cpp:94] viewIfPermitted still bypasses the guarded helper by calling else_table_function->getActualTableStructure(...) directly. For fallbacks whose structure resolution touches the source, for example url(..., 'auto'), DESCRIBE viewIfPermitted(... ELSE ...) reaches schema inference and network or file access without checkSourceAccess, even though the planner assumes table-function access was already checked in ITableFunction::execute. The direct executable() gap is fixed, but this wrapper leaves the same structure-only access invariant incomplete.
    Suggested fix: route the fallback through getActualTableStructureWithAccess, or reject fallbacks that need source or engine access on the structure path, and add a regression for nested DESCRIBE viewIfPermitted(... ELSE url(..., 'auto')) without the source grant.
Final Verdict
  • Status: ❌ Block
  • Minimum required actions: close the remaining viewIfPermitted structure-path bypass for nested source-backed fallbacks and cover it with a focused regression.

LLVM Coverage Report

⚠️ No coverage measurement for commit b7b9c3c: bash ci/jobs/scripts/generate_diff_coverage_report.sh failed (its output is on the Generate LLVM Coverage Diff Report result).

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 3, 2026
@groeneai
groeneai force-pushed the fix-table-function-engine-grant branch from fe85821 to c5203bf Compare July 4, 2026 00:27
@groeneai

groeneai commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Update (revised fix). The previous revision gated TABLE ENGINE for all non-source, non-empty engine table functions. That over-reached: it newly required GRANT TABLE ENGINE ON Loop/ON Dictionary/... for wrapper/proxy table functions (loop, dictionary, merge, view, remote) whose access is already delegated to the wrapped object, breaking four existing stateless tests (03680_loop_table_function_access_check, 04411_loop_table_function_describe_access_check, 03928_loop_row_policy, 03273_dictionary_rbac) that assert that delegated-access contract. The fix is now scoped to the capability engine via an opt-in virtual requiresTableEngineGrant(), set true only on TableFunctionExecutable (executable()/executablePool()). Wrapper/pseudo/source table functions are unchanged.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With table_engines_require_grant=true, as a user with GRANT SELECT, CREATE TEMPORARY TABLE ON *.* (no TABLE ENGINE ON Executable): SELECT * FROM executable('sh -c id','TabSeparated','x String') ran the script (bug); CREATE TABLE ... ENGINE=Executable was correctly denied. Deterministic on every run.
b Root cause explained? ITableFunction::execute()/getActualTableStructureWithAccess() checked only checkSourceAccess() (no-op for Executable, which has no source_access_type) + CREATE_TEMPORARY_TABLE, never AccessType::TABLE_ENGINE. The persistent CREATE TABLE path checks it (InterpreterCreateQuery), so executable() reached StorageExecutable's script-execution capability while ENGINE=Executable was denied.
c Fix matches root cause? Yes. Adds the missing TABLE_ENGINE check on the exact two surfaces (execute() + structure resolution = SELECT/DESCRIBE/CREATE TABLE AS), scoped to the capability engine that lacks any other gate.
d Test intent preserved / new tests added? Yes. Added executable() SELECT/DESCRIBE deny-without-grant / allow-with-grant, plus regression asserts for wrapper/pseudo/source TFs. The 4 pre-existing wrapper tests (loop/dictionary/row-policy) keep their delegated-access assertions and pass unchanged.
e Both directions demonstrated? Yes. Without fix: executable() ran the script. With fix: denied TABLE ENGINE ON Executable; with the grant it passes access (fails on missing script). The 4 wrapper tests [ OK ] under clickhouse-test with the narrowed fix (they FAIL under the broad gate).
f Fix general across code paths? Yes. Gated on both execute() and getActualTableStructureWithAccess(), the two ITableFunction access surfaces. executablePool() shares TableFunctionExecutable (engine Executable), so it is covered by the same opt-in.
g Fix generalizes across inputs? Yes. The check keys on the engine name, independent of script/args/format/structure and pool-vs-non-pool. Wrapper/pseudo/source TFs verified unaffected (numbers/values/null/merge/loop/dictionary/url).
h Backward compatible? Yes. No-op when table_engines_require_grant=false (default; ContextAccess implicitly grants non-source engines). When enabled, executable() now requires GRANT TABLE ENGINE ON Executable — the intended hardening, mirroring the already-enforced CREATE TABLE ... ENGINE=Executable; no behavior change for wrapper engines. No setting default / on-disk / wire format change.
i Invariants and contracts preserved? Yes. Mirrors the ContextAccess source<->TABLE_ENGINE sync model (source engines gated by filter-aware checkSourceAccess; non-source capability engine gated by TABLE_ENGINE). requiresTableEngineGrant() defaults false, so wrapper/pseudo/source TFs keep their existing contracts; no new lookup/throw surface beyond the engine-name check.

Session id: cron:clickhouse-worker-slot-4:20260703-234500

@groeneai

groeneai commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — c5203bf

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 2/2) / 03411_dynamic_resize_filesystem_cache_3 flaky (4 unrelated PRs / 0 master in 30d; RBAC diff has no causal link to a filesystem-cache-resize test) a fix task is created (investigating at full effort — fixing PR link to follow here)
CH Inc sync private sync CH Inc sync (private, not actionable)

The PR-caused Loop/Dictionary over-gate failures from the prior head (fe858210) were fixed here on c5203bf by narrowing the gate to Executable/ExecutablePool only (opt-in requiresTableEngineGrant()); all Bugfix-validation integration tests and stateless lanes are green on this head except the single flaky above.

Session id: cron:our-pr-ci-monitor:20260704-043000

@groeneai

groeneai commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the flaky 03411_dynamic_resize_filesystem_cache_3 (surfaced on this PR's CI): #109391

executable()/executablePool() run a server-side script under the server's
OS user, but table functions checked only source access (READ/WRITE ON
S3/URL/...) plus CREATE TEMPORARY TABLE, never the TABLE ENGINE grant that
CREATE TABLE enforces. So with table_engines_require_grant=true,
SELECT/DESCRIBE over executable(...) bypassed the engine denial: it ran a
server-side script even though ENGINE=Executable was denied without
GRANT TABLE ENGINE ON Executable.

Add ITableFunction::checkEngineAccess(), called from execute() and
getActualTableStructureWithAccess() (covers SELECT, DESCRIBE, CREATE TABLE
AS). It is scoped to capability engines via a new opt-in virtual
requiresTableEngineGrant(), set only on TableFunctionExecutable. Wrapper/
proxy engine table functions (merge/loop/dictionary/view/distributed) stay
gated by their delegated data access, source engines by checkSourceAccess,
and pseudo-engines (numbers/values/...) need no grant, so none of them opt
in. No-op when table_engines_require_grant=false.
@groeneai
groeneai force-pushed the fix-table-function-engine-grant branch from c5203bf to ab2ca32 Compare July 8, 2026 11:28
@clickhouse-gh

clickhouse-gh Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.90% 85.90% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 78.00% 78.00% +0.00%

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

Full report · Diff report

@groeneai

groeneai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — ab2ca32

CI fully finished after the 2026-07-08 rebase onto master (Finish Workflow + Mergeable Check green). Every failure below has an owner.

Check / test Reason Owner / fixing PR
Sync — CH Inc sync (private, not actionable by us)

The two Bugfix validation (integration tests, amd64/aarch64) jobs are green at job level: the per-test FAIL rows on test_with_table_engine_grant.py are the expected master-HEAD baseline (the regression test must fail on master and pass on the PR), not failures of this PR.

Session id: cron:our-pr-ci-monitor:20260708-153000

@thevar1able thevar1able self-assigned this Jul 22, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 40 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 44d6e8a0-92ed-4763-9ecf-089d2de2b3bc
  • MIRAI run: 6e23bfb0-b415-4dc9-8040-48d90209ee40
  • PR check IDs:
    • clickbench_909147_1788368737
    • clickbench_909153_1788368737
    • clickbench_909164_1788368738
    • tpch_adapted_1_official_909170_1788368737
    • tpch_adapted_1_official_909182_1788368737
    • tpch_adapted_1_official_909218_1788368737

Resolves a conflict in `ITableFunction::execute`, where master gained the
`check_create_temporary_table` and `check_source_access` parameters for the `URL`
database engine (which resolves its tables through the `url` table function).

`checkEngineAccess` is called unconditionally rather than under
`check_source_access`. That flag means the caller has taken over the *source*
check because it cannot yet know the direction of the access; neither caller that
passes it as false (`DatabaseURL::getTableImpl` and `TableFunctionURL::executeImpl`
delegation) performs an engine-grant check, so gating on it would silently drop the
grant enforcement this change adds. It is a no-op for those paths anyway: only
`TableFunctionExecutable` opts in via `requiresTableEngineGrant`, and `url` and its
delegates are source engines.
The rationale for gating only capability engines, and for calling `checkEngineAccess`
outside `check_source_access`, belongs in the commit history rather than at each call
site. Keep at each site only what the next reader needs there.
Only the `executable` table function is registered here; `ExecutablePool` is a table
engine registered by `StorageExecutable`. The gate is on the `Executable` engine name
either way, so this is a wording fix with no behavior change.
{
/// Resolving table structure is always a read operation.
checkSourceAccess(context, /*is_insert_query*/ false);
checkEngineAccess(context);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getActualTableStructureWithAccess only protects callers that actually delegate to it. TableFunctionViewIfPermitted::getActualTableStructure still calls its fallback's raw getActualTableStructure (src/TableFunctions/TableFunctionViewIfPermitted.cpp:92-95), so the structure-only paths are still bypassable when the dangerous table function is nested: DESCRIBE / CREATE TABLE AS viewIfPermitted(... ELSE executable(...)) skip the new TABLE ENGINE check, and source-backed fallbacks such as url(..., 'auto') still do schema inference without checkSourceAccess. If the contract here is "all table-function structure resolution goes through the guarded helper", this wrapper needs its own guard/reject path and a regression for the nested case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right about the code path, and I have corrected the PR description because of it. On severity I disagree for the engine axis, and I agree the source-axis gap is real but think it belongs in its own PR. Measurements below, on this head (server buildId 7A89F7F0...) with table_engines_require_grant = true and a user holding only CREATE TEMPORARY TABLE.

Engine axis. TableFunctionViewIfPermitted::getActualTableStructure does call the fallback's raw getActualTableStructure, so checkEngineAccess is skipped there. But the capability stays gated, including the CREATE TABLE AS shapes:

probe result script ran?
DESCRIBE executable(...) (baseline) Code: 497 TABLE ENGINE ON Executable -
SELECT via viewIfPermitted, incl. forced-ELSE with matching columns Code: 497 no
CREATE TABLE t ENGINE = Memory AS SELECT ... viewIfPermitted(...) Code: 497 no
CREATE TABLE t AS viewIfPermitted(...) creates a Proxy table no
reading that Proxy (as the user, and as full access) Code: 497 / 0 rows no
DESCRIBE viewIfPermitted(SELECT 1 ELSE executable(...)) returns x String no

Execution routes through else_table_function->execute, which does check the grant. The probe script touched a sentinel file, and a full-access control run of executable created it, so those "no" results are a live oracle rather than a blind assertion. The CREATE TABLE t AS row does persist a structure-only Proxy from InterpreterCreateQuery, but no read of it reaches the script.

So the residue is DESCRIBE echoing a structure the caller supplied itself in the same statement, since executable takes its structure as an explicit literal argument. That is worth documenting, not gating, and I have added it to the description - my previous wording claimed the two guarded surfaces cover DESCRIBE unconditionally, which was wrong for the nested case.

Source axis. Confirmed real, and pre-existing. Timing against a closed port separates a denial from a connection attempt:

arm probe rc wall
this PR DESCRIBE url(...), no READ ON URL 241 81 ms (Code: 497)
this PR nested in viewIfPermitted, no grant 124 25545 ms
this PR direct, full access 124 25018 ms
pristine master direct, no grant 241 218 ms (Code: 497)
pristine master nested, no grant 124 25017 ms

Nested-without-grant is indistinguishable from full access, and pristine master reproduces it exactly, so this PR neither introduces nor worsens it. TableFunctionViewIfPermitted.cpp is not in this diff (last touched by master 3dfacb15780a11b, an ancestor of this PR's merge base).

Routing that call through getActualTableStructureWithAccess would newly add source-access enforcement to an untouched master path, which is a user-visible access-control change to viewIfPermitted and needs its own tests and reviewer rather than riding along here. TableFunctionLoop.cpp:105 already delegates to the guarded helper, so that is the shape to follow. I am not dropping it.

@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — ac6cece

CI is fully finished on this head (175 check-runs, 0 incomplete, Config Workflow and
Finish Workflow both success). Every failure below has an owner: a fixing PR (ours or
external), or a full-effort fix task whose fixing-PR link will be posted here when it
opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (arm_asan_ubsan, s3) / Hung check failed, possible deadlock found Not PR-caused: one cancelled async-insert flush stuck 1226 s. hung_check.log holds exactly one stuck query, INSERT INTO test_r9y7b0a0m2j1.test_json (data) FORMAT TSV with is_cancelled: 1, a single thread [5388], 45 MB (so neither OOM nor a multi-thread deadlock), parked below deserializeObject under StreamingFormatExecutor, owning test 03365_json_rollback_bug.sh. That is the row-loop cancellation gap, not the RBAC change in this PR. 216 rows across 157 distinct PRs in 14 days, 44 of them on master #112646 (ours, open)

The Bugfix validation (integration tests, aarch64) and ... (amd64) arms both concluded
success: their failing test_grant_and_revoke rows are the before-binary reproducing the
bug this PR fixes, which is what those jobs are supposed to show, so they are not ledger rows.
The Build (arm_release) / Post Hooks CIDB row is likewise not a check failure: that check
concluded success and the build-profile hook's LogCluster query failed with code 500 is
reporting-sink infrastructure that does not affect the build artifact.

The other 153 checks are green; 21 are skipped by configuration.

Session id: cron:our-pr-ci-monitor:20260803-230000

@groeneai groeneai added the groeneai-origin-unknown PR origin: unclassified (legacy task) label Aug 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Dear @thevar1able, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@antonio2368

Copy link
Copy Markdown
Member

@groeneai merge latest master

@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Merged master @ 4e1add46ec15df58b82416d8b4951d9a8c310350, pushed as b7b9c3c71d4006a. No conflicts, and the diff against master is byte-identical to the change you reviewed (same patch-id, 4 files, +102/-0).

One text fix while I was there: the changelog entry named an executablePool table function, which does not exist. ExecutablePool is a table engine only, and the executable table function reports engine Executable, so the required grant is unchanged (TABLE ENGINE ON Executable). No code change.

@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing b7b9c3c71 with master bb3c0a852 (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

93 translation units recompiled, 569 s compile time in total, 92 of them have a recent master baseline.

Job report

@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - b7b9c3c71d4006a9967983fedc35d746b51711f9

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Parser memory check / Resolve master binary No master ``clickhouse-examples`` artifact was found. #110081 dropped the suppression of the workflow segment in the S3 prefix, so ci/jobs/parser_memory_check.py probes a hand-spelled REFs/master/<sha>/build_arm_release/ key that now 403s on every master sha it walks. CI-infra, and this diff touches no ci/ file: over 24 h the check reports error on 170 distinct pull requests (17,271 success rows in the same window), so it is a property of master #117701 (mine, merged 2026-09-02T16:49:23Z), rule 3c: measured ABSENT from this tree (0 occurrences of the symbol it adds at b7b9c3c71d40, 1 at its merge commit d4f4f2a50e0f, pre-fix control 0)
LLVM Coverage / Generate LLVM Coverage Diff Report, Print Uncovered Code the same S3 prefix change at the coverage call site: the baseline lookup and the report links are hand-spelled the same way. 606 failure rows across 96 distinct pull requests in 24 h, 0 on master #117718 (external, open)
Upgrade check (amd_release) / Error message in clickhouse-server.log (see upgrade_error_messages.txt) 04510_mutation_query_plan_only_virtual_columns asserts a mutation failure on purpose and _table cannot be materialized in a mutation, so a background MutatePlainMergeTreeTask logs Code: 16 ... Unexpected const virtual column: _table ... While executing MergeTreeSequentialSource (NO_SUCH_COLUMN_IN_TABLE), which the log scanner then flags. 52 rows on 52 distinct pull requests in 14 d, 0 on master #117218 (mine, merged 2026-09-02T14:31:57Z), rule 3c: measured ABSENT from this tree (0 occurrences of the allowlist line it adds at b7b9c3c71d40, 1 at its merge commit 84ac4b28254a, pre-fix control 0)
Sync - CH Inc sync (private, not actionable by me)

I am not merging master to pick the two merged fixes up in this tick. Mergeable Check gates on
all three rows, and the middle one is owned by a PR that is still open, so a rerun now cannot make
this head green. One later update collects all three instead of spending two CI cycles.

The praktika report has 0 DROPPED nodes of 175, so this is real signal and not a build-gate
cascade: 144 OK, 23 SKIPPED. My diff is 3 files under src/TableFunctions/ plus one
integration test.

Session id: cron:our-pr-ci-monitor:20260902-220000

@antonio2368
antonio2368 added this pull request to the merge queue Sep 3, 2026
@antonio2368 antonio2368 added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Sep 3, 2026
Merged via the queue into ClickHouse:master with commit dbed019 Sep 3, 2026
505 of 515 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 3, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 3, 2026
antonio2368 added a commit that referenced this pull request Sep 3, 2026
Resolve the ITableFunction conflict while preserving the TABLE ENGINE grant check from #109331 and the release branch interface layout.

Related: #117852
robot-clickhouse added a commit that referenced this pull request Sep 3, 2026
Cherry pick #109331 to 26.3: Enforce TABLE ENGINE grant in table functions
robot-clickhouse added a commit that referenced this pull request Sep 3, 2026
Cherry pick #109331 to 26.6: Enforce TABLE ENGINE grant in table functions
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 3, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 3, 2026
Backport #109331 to 26.8: Enforce TABLE ENGINE grant in table functions
clickhouse-gh Bot added a commit that referenced this pull request Sep 3, 2026
Backport #109331 to 26.6: Enforce TABLE ENGINE grant in table functions
antonio2368 added a commit that referenced this pull request Sep 3, 2026
Backport #109331 to 26.3: Enforce TABLE ENGINE grant in table functions
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Sep 4, 2026
antonio2368 added a commit that referenced this pull request Sep 4, 2026
Backport #109331 to 26.7: Enforce TABLE ENGINE grant in table functions
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-unknown PR origin: unclassified (legacy task) 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 Pull request should be backported intentionally. Use this label with great care! 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants