Check children first

This commit is contained in:
Kruglov Pavel 2024-03-06 15:31:19 +01:00 committed by GitHub
parent 09a392772d
commit 5b94f9b411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,18 +469,18 @@ static bool canEvaluateSubtree(const ActionsDAG::Node * node, const Block & allo
static bool isDeterministicInScopeOfQuery(const ActionsDAG::Node * node)
{
if (node->type != ActionsDAG::ActionType::FUNCTION)
return true;
if (!node->function_base->isDeterministicInScopeOfQuery())
return false;
for (const auto * child : node->children)
{
if (!isDeterministicInScopeOfQuery(child))
return false;
}
if (node->type != ActionsDAG::ActionType::FUNCTION)
return true;
if (!node->function_base->isDeterministicInScopeOfQuery())
return false;
return true;
}