[#7518] Parse CURRENT DATE as a synonym for CURRENT_DATE. Same for TIME[STAMP]

This commit is contained in:
Lukas Eder 2018-09-26 11:54:09 +02:00
parent 809286d325
commit 403a7351d4
2 changed files with 10 additions and 10 deletions

View File

@ -646,11 +646,11 @@ term =
| 'COUNT' '(' ( '*' | [ 'DISTINCT' | 'ALL' ] field ) ')' [ keep | filter ] [ over ]
| 'CUME_DIST' ( '(' ')' over | '(' fields ')' withinGroup )
| 'CURRVAL' '(' ( name | stringLiteral ) ')'
| 'CURRENT_DATE' [ '(' ')' ]
| 'CURRENT_SCHEMA' [ '(' ')' ]
| 'CURRENT_TIME' [ '(' ')' ]
| 'CURRENT_TIMESTAMP' [ '(' ')' ]
| 'CURRENT_USER' [ '(' ')' ]
| ( 'CURRENT' 'DATE' | 'CURRENT_DATE' ) [ '(' ')' ]
| ( 'CURRENT' 'SCHEMA' | 'CURRENT_SCHEMA' ) [ '(' ')' ]
| ( 'CURRENT' 'TIME' | 'CURRENT_TIME' ) [ '(' ')' ]
| ( 'CURRENT' 'TIMESTAMP' | 'CURRENT_TIMESTAMP' ) [ '(' ')' ]
| ( 'CURRENT' 'USER' | 'CURRENT_USER' ) [ '(' ')' ]
| 'CURDATE' '(' ')'
| 'CURTIME' '(' ')'
| dateLiteral

View File

@ -4471,9 +4471,9 @@ final class ParserImpl implements Parser {
if (S.is(type))
if ((field = parseFieldConcatIf(ctx)) != null)
return field;
else if (parseKeywordIf(ctx, "CURRENT_SCHEMA") && (parseIf(ctx, '(') && parse(ctx, ')') || true))
else if ((parseKeywordIf(ctx, "CURRENT_SCHEMA") || parseKeywordIf(ctx, "CURRENT SCHEMA")) && (parseIf(ctx, '(') && parse(ctx, ')') || true))
return currentSchema();
else if (parseKeywordIf(ctx, "CURRENT_USER") && (parseIf(ctx, '(') && parse(ctx, ')') || true))
else if ((parseKeywordIf(ctx, "CURRENT_USER") || parseKeywordIf(ctx, "CURRENT USER")) && (parseIf(ctx, '(') && parse(ctx, ')') || true))
return currentUser();
if (N.is(type))
@ -4495,11 +4495,11 @@ final class ParserImpl implements Parser {
return field;
if (D.is(type))
if (parseKeywordIf(ctx, "CURRENT_DATE") && (parseIf(ctx, '(') && parse(ctx, ')') || true))
if ((parseKeywordIf(ctx, "CURRENT_DATE") || parseKeywordIf(ctx, "CURRENT DATE")) && (parseIf(ctx, '(') && parse(ctx, ')') || true))
return currentDate();
else if (parseKeywordIf(ctx, "CURRENT_TIMESTAMP") && (parseIf(ctx, '(') && parse(ctx, ')') || true))
else if ((parseKeywordIf(ctx, "CURRENT_TIMESTAMP") || parseKeywordIf(ctx, "CURRENT TIMESTAMP")) && (parseIf(ctx, '(') && parse(ctx, ')') || true))
return currentTimestamp();
else if (parseKeywordIf(ctx, "CURRENT_TIME") && (parseIf(ctx, '(') && parse(ctx, ')') || true))
else if ((parseKeywordIf(ctx, "CURRENT_TIME") || parseKeywordIf(ctx, "CURRENT TIME")) && (parseIf(ctx, '(') && parse(ctx, ')') || true))
return currentTime();
else if (parseFunctionNameIf(ctx, "CURDATE") && parse(ctx, '(') && parse(ctx, ')'))
return currentDate();