luoluoyuyu commented on PR #19128: URL: https://github.com/apache/iotdb/pull/19128#issuecomment-6656301118
Database auto-creation is still not covered by the policy. Table LOAD: LoadTsFileTableSchemaCache.createTableAndDatabaseIfNecessary() (L322) calls autoCreateTableDatabaseIfAbsent() whenever needToCreateDatabase, and that method (L353) only checks the global config — neither allowAutoCreateSchema nor the session flag. With global enabled + 'auto-create-schema'='false' (or enableAutoCreateSchema=false) + a missing database, LOAD still runs CREATE DATABASE, then fails table validation, leaving an empty database behind. Tree LOAD: TreeSchemaAutoCreatorAndVerifier.autoCreateDatabase() (L276) runs whenever isAutoCreateDatabase, which defaults to the global config and ignores both the request attribute and the session flag. Async load: ActiveLoadTsFileLoader.loadTsFile() sets autoCreateDatabase from the global config as well. LoadTsFileAnalyzer.isAutoCreateSchemaEnabled (L152) is still global && request, so the session flag never reaches the autoCreateDatabase decision. Suggest computing one effective policy (global && request && session) in the analyzer and using it for database/table/column creation, and throwing a clear "database does not exist, auto-create-schema disabled" error instead of creating it. Current tests all set setAutoCreateDatabase(false) and the IT pre-creates the database, so this path is untested. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
