Using std::shared_ptr for functions and AST [#METR-21503].

This commit is contained in:
Alexey Milovidov 2016-05-28 18:50:16 +03:00
parent fc65afb6f0
commit 6a51b999da
3 changed files with 6 additions and 6 deletions

View File

@ -204,9 +204,9 @@ private:
return; return;
IdentifierNameSet identifiers{}; IdentifierNameSet identifiers{};
collectIdentifiersNoSubqueries(condition, identifiers); collectIdentifiersNoSubqueries(condition.get(), identifiers);
if (hasPrimaryKeyAtoms(condition) || !isSubsetOfTableColumns(identifiers)) if (hasPrimaryKeyAtoms(condition.get()) || !isSubsetOfTableColumns(identifiers))
return; return;
/// if condition is not "good" - check that it can be moved /// if condition is not "good" - check that it can be moved

View File

@ -246,7 +246,7 @@ void StorageDistributed::reshardPartitions(ASTPtr query, const String & database
if (!resharding_worker.isStarted()) if (!resharding_worker.isStarted())
throw Exception{"Resharding background thread is not running", ErrorCodes::RESHARDING_NO_WORKER}; throw Exception{"Resharding background thread is not running", ErrorCodes::RESHARDING_NO_WORKER};
if (coordinator) if (!coordinator.isNull())
throw Exception{"Use of COORDINATE WITH is forbidden in ALTER TABLE ... RESHARD" throw Exception{"Use of COORDINATE WITH is forbidden in ALTER TABLE ... RESHARD"
" queries for distributed tables", " queries for distributed tables",
ErrorCodes::RESHARDING_INVALID_PARAMETERS}; ErrorCodes::RESHARDING_INVALID_PARAMETERS};
@ -286,9 +286,9 @@ void StorageDistributed::reshardPartitions(ASTPtr query, const String & database
ASTAlterQuery::Parameters & parameters = alter_query.parameters.back(); ASTAlterQuery::Parameters & parameters = alter_query.parameters.back();
parameters.type = ASTAlterQuery::RESHARD_PARTITION; parameters.type = ASTAlterQuery::RESHARD_PARTITION;
if (first_partition) if (!first_partition.isNull())
parameters.partition = std::make_shared<ASTLiteral>({}, first_partition); parameters.partition = std::make_shared<ASTLiteral>({}, first_partition);
if (last_partition) if (!last_partition.isNull())
parameters.last_partition = std::make_shared<ASTLiteral>({}, last_partition); parameters.last_partition = std::make_shared<ASTLiteral>({}, last_partition);
ASTPtr expr_list = std::make_shared<ASTExpressionList>(); ASTPtr expr_list = std::make_shared<ASTExpressionList>();

View File

@ -122,7 +122,7 @@ void StorageMaterializedView::drop()
if (context.tryGetTable(database_name, inner_table_name)) if (context.tryGetTable(database_name, inner_table_name))
{ {
/// Состваляем и выполняем запрос drop для внутреннего хранилища. /// Состваляем и выполняем запрос drop для внутреннего хранилища.
ASTDropQuery *drop_query = std::make_shared<ASTDropQuery>(); auto drop_query = std::make_shared<ASTDropQuery>();
drop_query->database = database_name; drop_query->database = database_name;
drop_query->table = inner_table_name; drop_query->table = inner_table_name;
ASTPtr ast_drop_query = drop_query; ASTPtr ast_drop_query = drop_query;