basic version of coalesce function

This commit is contained in:
2022-03-08 17:35:08 +01:00
parent 056b45c831
commit 038d891db5
6 changed files with 56 additions and 22 deletions

View File

@@ -173,6 +173,9 @@ std::unique_ptr<ValueNode> USql::eval_function_value_node(Table *table, Row &row
evaluatedPars.push_back(eval_value_node(table, row, param.get(), nullptr, nullptr));
}
// coalesce function can have first parameter null, so must be calles before following "return null"
if (fnc->function == FunctionNode::Type::coalesce) return coalesce_function(evaluatedPars);
if (evaluatedPars.empty() || evaluatedPars[0]->isNull())
return std::make_unique<NullValueNode>();