mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-25 03:00:49 +00:00
CLICKHOUSE-3819 add CASE without ELSE
This commit is contained in:
parent
88f1346be4
commit
a93d527b34
@ -50,8 +50,20 @@ bool ParserCase::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
if (!has_branch)
|
||||
return false;
|
||||
|
||||
if (!s_else.ignore(pos, expected))
|
||||
return false;
|
||||
if (s_else.ignore(pos, expected))
|
||||
{
|
||||
ASTPtr expr_else;
|
||||
if (!p_expr.parse(pos, expr_else, expected))
|
||||
return false;
|
||||
args.push_back(expr_else);
|
||||
}
|
||||
else
|
||||
{
|
||||
Field field;
|
||||
ASTLiteral null_literal(field);
|
||||
DB::IAST ptr_ = &null_literal;
|
||||
args.push_back(ptr_);
|
||||
}
|
||||
|
||||
ASTPtr expr_else;
|
||||
if (!p_expr.parse(pos, expr_else, expected))
|
||||
|
Loading…
Reference in New Issue
Block a user