diff --git a/dbms/src/Databases/DatabaseLazy.h b/dbms/src/Databases/DatabaseLazy.h index 4ff77f279b6..0a4ca04a143 100644 --- a/dbms/src/Databases/DatabaseLazy.h +++ b/dbms/src/Databases/DatabaseLazy.h @@ -94,7 +94,7 @@ private: time_t metadata_modification_time; CacheExpirationQueue::iterator expiration_iterator; - CachedTable() {} + CachedTable() = delete; CachedTable(const StoragePtr & table_, time_t last_touched_, time_t metadata_modification_time_) : table(table_), last_touched(last_touched_), metadata_modification_time(metadata_modification_time_) {} }; diff --git a/dbms/src/Databases/DatabaseWithDictionaries.cpp b/dbms/src/Databases/DatabaseWithDictionaries.cpp index 445653b8f31..b536d8a21b1 100644 --- a/dbms/src/Databases/DatabaseWithDictionaries.cpp +++ b/dbms/src/Databases/DatabaseWithDictionaries.cpp @@ -52,7 +52,7 @@ void DatabaseWithDictionaries::detachDictionary(const String & dictionary_name, } -void DatabaseWithDictionaries::createDictionary( const Context & context, const String & dictionary_name, const ASTPtr & query) +void DatabaseWithDictionaries::createDictionary(const Context & context, const String & dictionary_name, const ASTPtr & query) { const auto & settings = context.getSettingsRef(); diff --git a/dbms/src/Storages/StorageFile.cpp b/dbms/src/Storages/StorageFile.cpp index 63742535fab..eb6e45ecc72 100644 --- a/dbms/src/Storages/StorageFile.cpp +++ b/dbms/src/Storages/StorageFile.cpp @@ -101,7 +101,7 @@ static std::string getTablePath(const std::string & table_dir_path, const std::s } /// Both db_dir_path and table_path must be converted to absolute paths (in particular, path cannot contain '..'). -static void checkCreationIsAllowed(Context & context_global, const std::string & db_dir_path, const std::string & table_path) +static void checkCreationIsAllowed(const Context & context_global, const std::string & db_dir_path, const std::string & table_path) { if (context_global.getApplicationType() != Context::ApplicationType::SERVER) return; @@ -358,7 +358,7 @@ void registerStorageFile(StorageFactory & factory) String format_name = engine_args[0]->as().value.safeGet(); StorageFile::CommonArguments common_args{args.database_name, args.table_name, format_name, - args.columns, args.constraints,args.context}; + args.columns, args.constraints, args.context}; if (engine_args.size() == 1) /// Table in database return StorageFile::create(args.relative_data_path, common_args); diff --git a/dbms/src/Storages/StorageFile.h b/dbms/src/Storages/StorageFile.h index e5fd8a40094..66e3760821e 100644 --- a/dbms/src/Storages/StorageFile.h +++ b/dbms/src/Storages/StorageFile.h @@ -49,7 +49,7 @@ public: const std::string & format_name; const ColumnsDescription & columns; const ConstraintsDescription & constraints; - Context & context; + const Context & context; }; protected: @@ -71,7 +71,7 @@ private: std::string table_name; std::string database_name; std::string format_name; - Context & context_global; + const Context & context_global; int table_fd = -1; diff --git a/dbms/tests/queries/0_stateless/01018_ddl_dictionaries_create.sql b/dbms/tests/queries/0_stateless/01018_ddl_dictionaries_create.sql index 55d280cf045..16ca5412e32 100644 --- a/dbms/tests/queries/0_stateless/01018_ddl_dictionaries_create.sql +++ b/dbms/tests/queries/0_stateless/01018_ddl_dictionaries_create.sql @@ -91,7 +91,7 @@ CREATE DICTIONARY memory_db.dict2 PRIMARY KEY key_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict')) LIFETIME(MIN 1 MAX 10) -LAYOUT(FLAT()); -- {serverError 1} +LAYOUT(FLAT()); -- {serverError 48} SHOW CREATE DICTIONARY memory_db.dict2; -- {serverError 487} @@ -116,7 +116,7 @@ CREATE DICTIONARY lazy_db.dict3 PRIMARY KEY key_column, second_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict')) LIFETIME(MIN 1 MAX 10) -LAYOUT(COMPLEX_KEY_HASHED()); -- {serverError 1} +LAYOUT(COMPLEX_KEY_HASHED()); -- {serverError 48} DROP DATABASE IF EXISTS lazy_db;