Skip to content

Commit

Permalink
fix clang tidy
Browse files Browse the repository at this point in the history
Signed-off-by: hehechen <awd123456sss@gmail.com>
  • Loading branch information
hehechen committed May 24, 2022
1 parent 7da3784 commit 434a9da
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions dbms/src/Interpreters/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct ContextShared
PathCapacityMetricsPtr path_capacity_ptr; /// Path capacity metrics
FileProviderPtr file_provider; /// File provider.
IORateLimiter io_rate_limiter;
PageStorageRunMode storage_run_mode;
PageStorageRunMode storage_run_mode = PageStorageRunMode::ONLY_V3;
DM::GlobalStoragePoolPtr global_storage_pool;
/// Named sessions. The user could specify session identifier to reuse settings and temporary tables in subsequent requests.

Expand Down Expand Up @@ -714,7 +714,7 @@ Dependencies Context::getDependencies(const String & database_name, const String
checkDatabaseAccessRightsImpl(db);
}

ViewDependencies::const_iterator iter = shared->view_dependencies.find(DatabaseAndTableName(db, table_name));
auto iter = shared->view_dependencies.find(DatabaseAndTableName(db, table_name));
if (iter == shared->view_dependencies.end())
return {};

Expand All @@ -728,7 +728,7 @@ bool Context::isTableExist(const String & database_name, const String & table_na
String db = resolveDatabase(database_name, current_database);
checkDatabaseAccessRightsImpl(db);

Databases::const_iterator it = shared->databases.find(db);
auto it = shared->databases.find(db);
return shared->databases.end() != it
&& it->second->isTableExist(*this, table_name);
}
Expand All @@ -754,7 +754,7 @@ void Context::assertTableExists(const String & database_name, const String & tab
String db = resolveDatabase(database_name, current_database);
checkDatabaseAccessRightsImpl(db);

Databases::const_iterator it = shared->databases.find(db);
auto it = shared->databases.find(db);
if (shared->databases.end() == it)
throw Exception(fmt::format("Database {} doesn't exist", backQuoteIfNeed(db)), ErrorCodes::UNKNOWN_DATABASE);

Expand All @@ -771,7 +771,7 @@ void Context::assertTableDoesntExist(const String & database_name, const String
if (check_database_access_rights)
checkDatabaseAccessRightsImpl(db);

Databases::const_iterator it = shared->databases.find(db);
auto it = shared->databases.find(db);
if (shared->databases.end() != it && it->second->isTableExist(*this, table_name))
throw Exception(fmt::format("Table {}.{} already exists.", backQuoteIfNeed(db), backQuoteIfNeed(table_name)), ErrorCodes::TABLE_ALREADY_EXISTS);
}
Expand Down Expand Up @@ -826,7 +826,7 @@ Tables Context::getExternalTables() const

StoragePtr Context::tryGetExternalTable(const String & table_name) const
{
TableAndCreateASTs::const_iterator jt = external_tables.find(table_name);
auto jt = external_tables.find(table_name);
if (external_tables.end() == jt)
return StoragePtr();

Expand Down Expand Up @@ -864,7 +864,7 @@ StoragePtr Context::getTableImpl(const String & database_name, const String & ta
String db = resolveDatabase(database_name, current_database);
checkDatabaseAccessRightsImpl(db);

Databases::const_iterator it = shared->databases.find(db);
auto it = shared->databases.find(db);
if (shared->databases.end() == it)
{
if (exception)
Expand Down Expand Up @@ -894,7 +894,7 @@ void Context::addExternalTable(const String & table_name, const StoragePtr & sto

StoragePtr Context::tryRemoveExternalTable(const String & table_name)
{
TableAndCreateASTs::const_iterator it = external_tables.find(table_name);
auto it = external_tables.find(table_name);

if (external_tables.end() == it)
return StoragePtr();
Expand Down Expand Up @@ -954,7 +954,7 @@ std::unique_ptr<DDLGuard> Context::getDDLGuardIfTableDoesntExist(const String &
{
auto lock = getLock();

Databases::const_iterator it = shared->databases.find(database);
auto it = shared->databases.find(database);
if (shared->databases.end() != it && it->second->isTableExist(*this, table))
return {};

Expand Down Expand Up @@ -993,7 +993,7 @@ ASTPtr Context::getCreateTableQuery(const String & database_name, const String &

ASTPtr Context::getCreateExternalTableQuery(const String & table_name) const
{
TableAndCreateASTs::const_iterator jt = external_tables.find(table_name);
auto jt = external_tables.find(table_name);
if (external_tables.end() == jt)
throw Exception(fmt::format("Temporary table {} doesn't exist", backQuoteIfNeed(table_name)), ErrorCodes::UNKNOWN_TABLE);

Expand Down Expand Up @@ -1088,7 +1088,7 @@ void Context::setCurrentQueryId(const String & query_id)
UInt64 a;
UInt64 b;
};
} random;
} random{};

{
auto lock = getLock();
Expand Down

0 comments on commit 434a9da

Please sign in to comment.