Fix unary operators parsing

This commit is contained in:
Nikolay Degterinsky 2023-12-09 22:44:06 +00:00
parent 62d0d76f68
commit fc8656ee9e
3 changed files with 13 additions and 2 deletions

View File

@ -2614,8 +2614,17 @@ Action ParserExpressionImpl::tryParseOperand(Layers & layers, IParser::Pos & pos
if (cur_op != unary_operators_table.end())
{
layers.back()->pushOperator(cur_op->second);
return Action::OPERAND;
if (pos->type == TokenType::OpeningRoundBracket)
{
++pos;
auto identifier = std::make_shared<ASTIdentifier>(cur_op->second.function_name);
layers.push_back(getFunctionLayer(identifier, layers.front()->is_table_function));
return Action::OPERAND;
}
else
{
layers.back()->pushOperator(cur_op->second);
}
}
auto old_pos = pos;

View File

@ -0,0 +1 @@
SELECT NOT (0) + NOT (0);