Repository navigation
Conversation
…EXCHANGE `StorageObjectStorage` kept its own copy of its `StorageID`, initialised once in the constructor. `RENAME TABLE`, `EXCHANGE TABLES` and `RENAME DATABASE` update only the id of `IStorage` (`IStorage::renameInMemory`), so the copy kept the name the table was created with, and every reader of it used the old name: - `alter` loaded the stored CREATE of the old name for the `max_query_size` check and then called `alterTable` with the old id. After a RENAME the old name does not exist, so `ALTER TABLE ... COMMENT COLUMN` (and, for data lake tables, ADD/DROP/MODIFY COLUMN) failed with CANNOT_GET_CREATE_TABLE_QUERY. After an EXCHANGE the old name belongs to the partner table: an `Alias` partner has no columns in its stored CREATE, so `applyMetadataChangesToCreateQuery` threw LOGICAL_ERROR (found by La Casa Del Dolor, STID 3623-3a50); any other partner failed the UUID check of `alterTable` after an Iceberg table had already written its new metadata. - `alterSettings` called `alterTable` with the old id, so MODIFY SETTING of a renamed data lake table failed the same way. - `read` passed the old name to `ReadFromObjectStorageStep`, so `_table` returned the old name. Remove the copy and use `getStorageID()` everywhere, as the rest of the class (`mutate`, `alterPartition`, `configuration->alter`) and `StorageObjectStorageCluster` already do. 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).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261120-060404 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261120-051205 |
|
Workflow [PR], commit [eb8c52b] Summary: ✅
AI ReviewSummaryRemoves the stale Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units109 translation units recompiled, 839 s compile time in total, 109 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed
ALTER TABLEof anS3,AzureBlobStorage,HDFSor data lake table afterRENAME TABLE,EXCHANGE TABLESorRENAME DATABASE: it failed withCANNOT_GET_CREATE_TABLE_QUERYor another table's error (aLOGICAL_ERRORwhen the other table is anAlias), and the_tablevirtual column of such a table returned its old name.Description
On 26.8 and 26.10,
RENAME TABLE t TO t2followed byALTER TABLE t2 COMMENT COLUMN c 'x'on anS3table is rejected withCANNOT_GET_CREATE_TABLE_QUERY(Table t doesn't exist), andSELECT _table FROM t2returnst.Found by La Casa Del Dolor: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130259&sha=ec0f52f7aad97919cf5cfdc16144373541b929db&name_0=PR&name_1=La%20Casa%20Del%20Dolor%20%28amd_debug%29 (
Logical error: 'Cannot alter table t27 metadata doesn't have structure', STID 3623-3a50).StorageObjectStoragekept its own copy of itsStorageID, set in the constructor.RENAME/EXCHANGE/RENAME DATABASEupdate only the id ofIStorage, soalter(themax_query_sizecheck andalterTable),alterSettingsandread(_table) kept using the old name. AfterEXCHANGE TABLESwith anAliastable, whose stored definition has no columns, the check throws theLOGICAL_ERROR; with any other partner,alterTablefails its UUID check after an Iceberg table has already written its new metadata.The copy is removed and
getStorageID()is used everywhere, asmutate,alterPartitionandStorageObjectStorageClusteralready do.Validation: the new test
05837_object_storage_alter_after_rename(S3andIcebergS3:_table,COMMENT COLUMNafterRENAMEand afterEXCHANGEwith anAlias,ADD COLUMNandMODIFY SETTINGof a renamed Iceberg table) fails on master and passes 50/50 with randomized settings. Fixing only themax_query_sizecheck is not enough:alterTableand_tablestill use the old name.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133156]