{"record":{"id":"1a6d01a3d4a9cc71","repo":"databendlabs/databend","slug":"not-implemented-1a6d01","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/catalogs/default/immutable_catalog.rs","lineNumber":462,"sourceCode":"            \"Cannot rename table in system database\",\n        ))\n    }\n\n    #[async_backtrace::framed]\n    async fn swap_table(&self, _req: SwapTableReq) -> Result<SwapTableReply> {\n        Err(ErrorCode::Unimplemented(\n            \"Cannot swap table in system database\",\n        ))\n    }\n\n    async fn commit_table_meta(&self, _req: CommitTableMetaReq) -> Result<CommitTableMetaReply> {\n        Err(ErrorCode::Unimplemented(\n            \"cannot commit_table_meta in system database\",\n        ))\n    }\n\n    async fn create_table_index(&self, _req: CreateTableIndexReq) -> Result<()> {\n        unimplemented!()\n    }\n\n    async fn drop_table_index(&self, _req: DropTableIndexReq) -> Result<()> {\n        unimplemented!()\n    }\n\n    #[async_backtrace::framed]\n    async fn get_table_copied_file_info(\n        &self,\n        _tenant: &Tenant,\n        _db_name: &str,\n        req: GetTableCopiedFileReq,\n    ) -> Result<GetTableCopiedFileReply> {\n        Err(ErrorCode::Unimplemented(format!(\n            \"get_table_copied_file_info not allowed for system database {:?}\",\n            req\n        )))\n    }","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/catalogs/default/immutable_catalog.rs#L444-L480","documentation":"The immutable (system database) catalog implements the Catalog trait but index management is meaningless for system tables, so `create_table_index` is a stub that panics with `unimplemented!`. This is a guard: the system catalog never supports creating indexes.","triggerScenarios":"Calling CREATE INDEX (or an index-mutating API) against a system database table (tables in the `system` catalog backed by ImmutableCatalog), reaching ImmutableCatalog::create_table_index.","commonSituations":"Trying to CREATE INDEX on a `system.*` table; tooling or scripts that generically apply index creation across all tables including system ones.","solutions":["Do not create indexes on system database tables; run the CREATE INDEX against a regular user database table instead","If a tool is doing this automatically, exclude the system catalog from its index-maintenance scope","If user-facing SQL should reject this gracefully, file an issue so the stub returns ErrorCode::Unimplemented instead of panicking"],"exampleFix":"-- before\nCREATE INDEX idx ON system.one(id);\n-- after: indexes only apply to user tables\nCREATE INDEX idx ON my_db.my_table(id);","handlingStrategy":"validation","validationCode":"if (statement.targetDatabase === \"system\" || statement.targetDatabase.startsWith(\"system.\")) {\n  throw new Error(\"Index operations are not allowed on the system database\");\n}","typeGuard":"function isSystemDatabase(dbName) {\n  return String(dbName).toLowerCase() === \"system\";\n}","tryCatchPattern":null,"preventionTips":["Never run index DDL against system.* tables","Exclude the system catalog in any generic index-maintenance tooling","Maintain an allowlist of databases eligible for index operations"],"tags":["rust","catalog","system-tables","index"],"backgroundTag":"method-not-implemented","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}