Skip to content

Commit 4ce98e4

Browse files
committed
fixes #554
1 parent ee723d5 commit 4ce98e4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Also I would like to know about needed examples or documentation stuff.
4141

4242
## Extensions in the latest SNAPSHOT version 1.2
4343

44+
* allowed **index** as object name
4445
* switched to JavaCC **modern template**
4546
* switched to JDK 1.7
4647
* introduced more AST node links

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ String RelObjectNameWithoutValue() :
961961
| tk=<K_OPEN> | tk=<K_OVER> | tk=<K_PERCENT> | tk=<K_PRIOR>
962962
| tk=<K_SEPARATOR> | tk=<K_NO> | tk=<K_ACTION> | tk=<K_CASCADE> | tk=<K_END>
963963
| tk=<K_TABLE> | tk=<K_DATETIMELITERAL> | tk=<K_COMMIT> | tk=<K_PRECISION>
964-
| tk=<K_INSERT>
964+
| tk=<K_INSERT> | tk=<K_INDEX>
965965
)
966966

967967
{ return tk.image; }
@@ -2974,7 +2974,7 @@ CreateTable CreateTable():
29742974
","
29752975

29762976
(
2977-
(
2977+
LOOKAHEAD(3) (
29782978
tk=<K_INDEX>
29792979
sk3=RelObjectName()
29802980
colNames=ColumnsNamesList()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,4 +2708,8 @@ public void testIssue522_3() throws JSQLParserException {
27082708
public void testIssue522_4() throws JSQLParserException {
27092709
assertSqlCanBeParsedAndDeparsed("SELECT CASE a + b WHEN -1 * 5 THEN 1 ELSE CASE b + c WHEN -1 * 6 THEN 2 ELSE 3 END END");
27102710
}
2711+
2712+
public void testIssue554() throws JSQLParserException {
2713+
assertSqlCanBeParsedAndDeparsed("SELECT T.INDEX AS INDEX133_ FROM myTable T");
2714+
}
27112715
}

0 commit comments

Comments
 (0)