Repository navigation
Reject a Nil INNER UUID in a TimeSeries target clause - #130698
nikitamikhaylov merged 1 commit into
Conversation
`CREATE TABLE t ENGINE = TimeSeries <kind> INNER UUID '00000000-0000-0000-0000-000000000000'` made `ParserViewTargets` create an `ASTViewTargets` and then drop the Nil UUID (`ASTViewTargets::setInnerUUID` only records a non-Nil one), so the query carried an empty `ViewTargets` child that formatting cannot print. The debug round-trip check in `executeQuery` then threw `Inconsistent AST formatting` and aborted the server (found by La Casa Del Dolor, STID 1941-1bfa). In release builds the clause was a silent no-op. Reject a Nil `<kind> INNER UUID` at parse time with BAD_ARGUMENTS, the same way `TO INNER UUID` and `ATTACH ... UUID` already reject Nil since ClickHouse#114171. Server-written metadata never contains such a clause (`ASTViewTargets::formatTarget` prints `INNER UUID` only for a non-Nil value), so stored tables are unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own cold review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261111-060500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261111-053600 |
|
Workflow [PR], commit [0feef2a] Summary: ✅
AI ReviewSummaryRejects explicit Nil Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units7 translation units recompiled, 7 s compile time in total, 7 of them have a recent master baseline. |
65ddb52
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
An
INNER UUIDclause of aTimeSeriestable target now rejects the Nil UUID withBAD_ARGUMENTS, asTO INNER UUIDalready does, instead of silently ignoring the clause.Description
A debug server aborts with
Logical error: 'Inconsistent AST formatting'(STID 1941-1bfa) onCREATE TABLE t ENGINE = TimeSeries RECENT SAMPLES INNER UUID '00000000-0000-0000-0000-000000000000'. La Casa Del Dolor (amd_debug) sent this statement: job report.Root cause:
ParserViewTargetscreates itsASTViewTargetsresult and then callssetInnerUUID, which records only a non-Nil UUID. So a NilINNER UUIDleaves an emptyViewTargetschild on theCREATEquery. The formatter prints nothing for it, the reparsed query has no such child, and the tree hashes differ. Release builds silently ignore the clause (26.8.18.2 and 26.10.3.7 format the statement asCREATE TABLE t ENGINE = TimeSeries).Change: reject a Nil
<kind> INNER UUIDat parse time withBAD_ARGUMENTS, the same way #114171 did forTO INNER UUIDandATTACH ... UUID.ParserViewTargetsis the only remainingINNER UUIDparse site, and only theTimeSeriesengine clause uses it. The server never writes such a clause into metadata (ASTViewTargets::formatTargetprintsINNER UUIDonly for a non-Nil value), so existing tables attach as before.Validation: the new test
05620_time_series_nil_inner_uuidcovers every target kind, including theDATAandMETRICSaliases. It aborts an unfixed debug server and passes 50/50 with randomized settings on the fixed one. 257 TimeSeries, AST JSON andINNER UUIDtests give the same results before and after the change.Workflow [PR]
Sync PR [sync-upstream/pr/130698]
Version info
26.11.1.1983-master(included in26.11and later)