mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix crash
This commit is contained in:
parent
f4037b8f54
commit
760e9a8488
@ -215,9 +215,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void replaceConstantExpressions(ASTPtr & node, const Context & context, const NamesAndTypesList & columns, ConstStoragePtr storage)
|
||||
void replaceConstantExpressions(
|
||||
ASTPtr & node,
|
||||
const Context & context,
|
||||
const NamesAndTypesList & columns,
|
||||
ConstStoragePtr storage,
|
||||
const StorageMetadataPtr & metadata_snapshot)
|
||||
{
|
||||
auto syntax_result = SyntaxAnalyzer(context).analyze(node, columns, storage);
|
||||
auto syntax_result = SyntaxAnalyzer(context).analyze(node, columns, storage, metadata_snapshot);
|
||||
Block block_with_constants = KeyCondition::getBlockWithConstants(node, syntax_result, context);
|
||||
|
||||
InDepthNodeVisitor<ReplacingConstantExpressionsMatcher, true> visitor(block_with_constants);
|
||||
@ -777,7 +782,7 @@ ClusterPtr StorageDistributed::skipUnusedShards(
|
||||
condition_ast = select.prewhere() ? select.prewhere()->clone() : select.where()->clone();
|
||||
}
|
||||
|
||||
replaceConstantExpressions(condition_ast, context, metadata_snapshot->getColumns().getAll(), shared_from_this());
|
||||
replaceConstantExpressions(condition_ast, context, metadata_snapshot->getColumns().getAll(), shared_from_this(), metadata_snapshot);
|
||||
const auto blocks = evaluateExpressionOverConstantCondition(condition_ast, sharding_key_expr);
|
||||
|
||||
// Can't get definite answer if we can skip any shards
|
||||
|
Loading…
Reference in New Issue
Block a user