mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
Fix potential seg fault with nullptr storage
This commit is contained in:
parent
6b4e5c75d2
commit
0c3679c76e
@ -409,12 +409,6 @@ InterpreterSelectQuery::InterpreterSelectQuery(
|
||||
{
|
||||
checkStackSize();
|
||||
|
||||
if (storage->hasExternalDynamicMetadata())
|
||||
{
|
||||
storage->updateExternalDynamicMetadata(context);
|
||||
metadata_snapshot = storage->getInMemoryMetadataPtr();
|
||||
}
|
||||
|
||||
if (!prepared_sets)
|
||||
prepared_sets = std::make_shared<PreparedSets>();
|
||||
|
||||
@ -469,6 +463,11 @@ InterpreterSelectQuery::InterpreterSelectQuery(
|
||||
|
||||
if (storage)
|
||||
{
|
||||
if (storage->hasExternalDynamicMetadata())
|
||||
{
|
||||
storage->updateExternalDynamicMetadata(context);
|
||||
metadata_snapshot = storage->getInMemoryMetadataPtr();
|
||||
}
|
||||
table_lock = storage->lockForShare(context->getInitialQueryId(), context->getSettingsRef().lock_acquire_timeout);
|
||||
table_id = storage->getStorageID();
|
||||
|
||||
|
@ -1783,7 +1783,6 @@ JoinTreeQueryPlan buildJoinTreeQueryPlan(const QueryTreeNodePtr & query_node,
|
||||
* then left most table expression is responsible for providing valid JOIN TREE part of final query plan.
|
||||
*
|
||||
* Examples: Distributed, LiveView, Merge storages.
|
||||
* Examples: Distributed, LiveView, Merge storages.
|
||||
*/
|
||||
auto left_table_expression = table_expressions_stack.front();
|
||||
auto left_table_expression_query_plan = buildQueryPlanForTableExpression(left_table_expression,
|
||||
|
Loading…
Reference in New Issue
Block a user