Repository navigation
Adjust a copied TimeSeries definition to the settings of the new table - #118517
nikitamikhaylov merged 2 commits into
Conversation
|
Workflow [PR], commit [469fab8] Summary: ✅
AI ReviewSummaryThis PR teaches Findings❌ Blockers
Tests
Final VerdictChanges requested. LLVM Coverage ReportMeasured on commit 469fab8.
Changed lines: Changed C/C++ lines covered: 515/569 (90.51%) · Uncovered code |
5de4a29 to
26f127d
Compare
26f127d to
82d7614
Compare
dde5caa to
79b8cd8
Compare
79b8cd8 to
64098d3
Compare
64098d3 to
b6ecea3
Compare
b8e6132 to
2acf90e
Compare
2acf90e to
eb315bf
Compare
6f8717c to
4a1c8d9
Compare
b01acc4 to
bbdb205
Compare
|
|
||
| /// The definition of the old table is read below. | ||
| auto old_database = context->resolveDatabase(create_query.as_database); | ||
| context->checkAccess(AccessType::SHOW_COLUMNS, old_database, create_query.as_table); |
There was a problem hiding this comment.
distributed_ddl_entry_format_version < NORMALIZE_CREATE_ON_INITIATOR_VERSION still bypasses this whole authorization path for ON CLUSTER. InterpreterCreateQuery::execute returns from the old-format branch before getTablePropertiesAndNormalizeCreateQuery() runs (src/Interpreters/InterpreterCreateQuery.cpp:3658-3692), and getRequiredAccess() does not add SHOW_COLUMNS on the AS source or its external targets. The worker legs then execute as internal queries (src/Interpreters/InterpreterCreateQuery.cpp:3660-3661), so the new checks here and in readTypesFromExternalTargets never run as the calling user.
A user with only CREATE TABLE and engine grants can therefore still do CREATE TABLE ... AS secret_ts ENGINE = TimeSeries ON CLUSTER ... with an old distributed DDL format and clone the source-backed types through worker-local normalization. This needs an initiator-side authorization or rejection before dispatch, because the worker-side checkAccess calls cannot enforce the caller's SHOW_COLUMNS privileges.
DataTypeLowCardinality.h was included twice, tripping readability-duplicate-include in the arm_tidy build.
bbdb205 to
469fab8
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes10 object files changed (+59.55 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units1626 translation units recompiled, 9751 s compile time in total, 1626 of them have a recent master baseline. |
PromQL Compliance ReportBaseline: S3 master
Note: score is unchanged vs baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Adjust a copied TimeSeries definition to the settings of the new table
Follow-up to #111204, also fixes #117839 (comment) and #117839 (comment)
Changes:
The copy follows its own settings. Inner columns and engines generated for the old table are generated again for the new one, so changing a setting in the copy (for example tags_to_columns or recent_samples_ttl_seconds) gives a consistent definition.
Customizations survive. Extra inner columns, custom codecs and defaults, engines with arguments, custom sorting keys and engine settings of the old table are copied as they are.
Settings are merged sensibly. Settings written in the query win, version is never copied so a copy always gets the latest schema, obsolete settings are dropped, and settings that make no sense with the new values are removed together, such as id_generator when the id type changes.
Types and replication are inherited. The timestamp, value and id types and the MergeTree/Replicated/Shared family come from the old table unless the query declares them. Mixed replication types among inner tables are rejected.
External targets are handled explicitly. They are not copied, so the query has to declare them or declare inner columns instead. A target replaced with an external table takes its types from that table.
Privileges. The copy requires SHOW COLUMNS on the old table and on any external table whose columns are read.
Workflow [PR]
Sync PR [sync-upstream/pr/118517]
Version info
26.9.1.956(included in26.9and later)