Skip to content

Commit 4c32302

Browse files
committed
fixes #1026
1 parent a923e7e commit 4c32302

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
@@ -1325,7 +1325,7 @@ String RelObjectNameWithoutValue() :
13251325
| tk=<K_ZONE> | tk=<K_COLUMNS> | tk=<K_DESCRIBE> | tk=<K_FN> | tk=<K_PATH>
13261326
| tk=<K_DATE_LITERAL> | tk=<K_NEXTVAL> | tk=<K_TRUE> | tk=<K_FALSE> | tk=<K_DUPLICATE>
13271327
| tk=<K_READ> | tk=<K_SCHEMA> | tk=<K_SIZE> | tk=<K_SESSION>
1328-
| tk=<K_VIEW> | tk=<K_NOLOCK> | tk=<K_VALIDATE> | tk=<K_CYCLE> | tk=<K_OF>
1328+
| tk=<K_VIEW> | tk=<K_NOLOCK> | tk=<K_VALIDATE> | tk=<K_CYCLE> | tk=<K_OF> | tk=<K_EXCLUDE>
13291329
/*| tk=<K_PLACING> | tk=<K_BOTH> | tk=<K_LEADING> | tk=<K_TRAILING> */
13301330
)
13311331

@@ -4123,7 +4123,7 @@ CreateTable CreateTable():
41234123
}
41244124
)
41254125
|
4126-
tk=<K_EXCLUDE> {excludeC = new ExcludeConstraint(); Expression exp = null;}
4126+
LOOKAHEAD(2) tk=<K_EXCLUDE> {excludeC = new ExcludeConstraint(); Expression exp = null;}
41274127
(tk2=<K_WHERE>
41284128
("(" exp = Expression() ")")* {excludeC.setExpression(exp);})
41294129
{

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4203,4 +4203,9 @@ public void testVariableAssignment3() throws JSQLParserException {
42034203
public void testKeyWordOfIssue1029() throws JSQLParserException {
42044204
assertSqlCanBeParsedAndDeparsed("SELECT of.Full_Name_c AS FullName FROM comdb.Offer_c AS of");
42054205
}
4206+
4207+
@Test
4208+
public void testKeyWordExceptIssue1026() throws JSQLParserException {
4209+
assertSqlCanBeParsedAndDeparsed("SELECT * FROM xxx WHERE exclude = 1");
4210+
}
42064211
}

0 commit comments

Comments
 (0)