Skip to content

Commit 6cb0860

Browse files
committed
Fixed segfault for STATS_COLLECTION_FULL
1 parent 17a0f88 commit 6cb0860

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ydb/core/kqp/session_actor/kqp_session_actor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,9 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
16051605
auto stats = QueryState->QueryStats.ToProto();
16061606
if (QueryState->GetStatsMode() >= Ydb::Table::QueryStatsCollection::STATS_COLLECTION_FULL) {
16071607
response->SetQueryPlan(SerializeAnalyzePlan(stats, QueryState->UserRequestContext->PoolId));
1608-
response->SetQueryAst(QueryState->CompileResult->PreparedQuery->GetPhysicalQuery().GetQueryAst());
1608+
if (QueryState->CompileResult && QueryState->CompileResult->PreparedQuery) {
1609+
response->SetQueryAst(QueryState->CompileResult->PreparedQuery->GetPhysicalQuery().GetQueryAst());
1610+
}
16091611
}
16101612
response->MutableQueryStats()->Swap(&stats);
16111613
}

0 commit comments

Comments
 (0)