Fixed parsing of NULL literal [#METR-19266].

This commit is contained in:
Alexey Milovidov 2016-12-29 22:52:15 +03:00
parent 3f678a3042
commit 18f0e83b51
3 changed files with 13 additions and 1 deletions

View File

@ -417,7 +417,7 @@ bool ParserCastExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & ma
bool ParserNull::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
Pos begin = pos;
ParserString nested_parser("NULL", true);
ParserString nested_parser("NULL", true, true);
if (nested_parser.parse(pos, end, node, max_parsed_pos, expected))
{
node = std::make_shared<ASTLiteral>(StringRange(StringRange(begin, pos)), Null());

View File

@ -0,0 +1,6 @@
1
1
1
0
1
0

View File

@ -0,0 +1,6 @@
SELECT NULL IS NULL;
SELECT Null IS NULL;
SELECT null is null;
SELECT nuLL IS NOT NULL;
SELECT NOT NULL IS NOT NULL;
SELECT NOT NULL IS null;