fix crash

This commit is contained in:
Artem Zuikov 2020-06-25 21:44:05 +03:00
parent ae5ed098f4
commit 0e49a9ed4d
2 changed files with 6 additions and 3 deletions

View File

@ -327,8 +327,12 @@ struct ExpressionActionsChain
ExpressionActionsPtr getLastActions(bool allow_empty = false) ExpressionActionsPtr getLastActions(bool allow_empty = false)
{ {
if (steps.empty() && !allow_empty) if (steps.empty())
{
if (allow_empty)
return {};
throw Exception("Empty ExpressionActionsChain", ErrorCodes::LOGICAL_ERROR); throw Exception("Empty ExpressionActionsChain", ErrorCodes::LOGICAL_ERROR);
}
return steps.back().actions; return steps.back().actions;
} }

View File

@ -1161,8 +1161,7 @@ ExpressionAnalysisResult::ExpressionAnalysisResult(
{ {
/// You may find it strange but we support read_in_order for HashJoin and do not support for MergeJoin. /// You may find it strange but we support read_in_order for HashJoin and do not support for MergeJoin.
auto join_algo = join->getTableJoinAlgo(); auto join_algo = join->getTableJoinAlgo();
const auto * hash_join = typeid_cast<HashJoin *>(join_algo.get()); join_allow_read_in_order = typeid_cast<HashJoin *>(join_algo.get()) && !join_algo->hasStreamWithNonJoinedRows();
join_allow_read_in_order = hash_join && !join_algo->hasStreamWithNonJoinedRows();
} }
optimize_read_in_order = optimize_read_in_order =