Skip to content

Commit 93b8c8b

Browse files
committed
fixes #1414
1 parent ebe171b commit 93b8c8b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ String RelObjectNameWithoutValue() :
16331633
{ Token tk = null; }
16341634
{
16351635
(tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER>
1636-
| tk=<K_ALGORITHM>
1636+
| tk=<K_ALGORITHM> | tk=<K_AT>
16371637
| tk=<K_BYTE> | tk=<K_CHAR> | tk=<K_CHANGE> | tk=<K_CHARACTER>
16381638
| tk=<K_CAST> | tk=<K_COMMENT> | tk=<K_COSTS> | tk=<K_DISABLE> | tk=<K_DESC>
16391639
| tk=<K_DO> | tk=<K_EXTRACT> | tk=<K_FILTER> | tk=<K_FIRST> | tk=<K_FOLLOWING> | tk=<K_JSON>
@@ -3763,7 +3763,7 @@ Expression PrimaryExpression() #PrimaryExpression:
37633763
retval=castExpr;
37643764
} )*
37653765

3766-
( <K_AT> <K_DATETIMELITERAL> <K_ZONE> timezoneRightExpr=PrimaryExpression() {
3766+
( LOOKAHEAD(2) <K_AT> <K_DATETIMELITERAL> <K_ZONE> timezoneRightExpr=PrimaryExpression() {
37673767
if (timezoneExpr == null)
37683768
timezoneExpr = new TimezoneExpression();
37693769

src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,4 +4956,9 @@ public void testLogicalExpressionSelectItemIssue1381() throws JSQLParserExceptio
49564956
assertSqlCanBeParsedAndDeparsed(
49574957
"SELECT ( 1 = 1 ) AND ( 1 = 2 )", true);
49584958
}
4959+
4960+
@Test
4961+
public void testKeywordAtIssue1414() throws JSQLParserException {
4962+
assertSqlCanBeParsedAndDeparsed("SELECT * FROM table1 at");
4963+
}
49594964
}

0 commit comments

Comments
 (0)