Skip to content

Commit

Permalink
Issue1352 (#1353)
Browse files Browse the repository at this point in the history
* Fixes #1352

Allow SYSTEM as table- or column- name

* Fixes #1352

Allow SYSTEM as tablename

* Fixes #1352

Allow SYSTEM as tablename and columnname

* Fixes #1352

Allow QUERY as tablename and columnname

* Fixes #1352

Allow FULLTEXT as tablename and columnname

Co-authored-by: Tobias <t.warneke@gmx.net>
  • Loading branch information
manticore-projects and wumpz authored Oct 9, 2021
1 parent 388b7c3 commit a8afd9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,9 @@ String RelObjectNameWithoutValue() :
| tk=<K_LOG> | tk=<K_DUMP> | tk=<K_FLUSH> | tk=<K_ACTIVE> | tk=<K_RESUME> | tk=<K_SWITCH> | tk=<K_SUSPEND>
| tk=<K_ARCHIVE> | tk=<K_QUIESCE> | tk=<K_HISTORY> | tk=<K_SHUTDOWN> | tk=<K_REGISTER> | tk=<K_UNQIESCE>
| tk=<K_RESTRICTED> | tk=<K_CHECKPOINT> | tk=<K_DISCONNECT>

| tk=<K_SYSTEM>
| tk=<K_QUERY>
| tk=<K_FULLTEXT>
| tk=<K_TABLESPACE>
)

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,16 @@ public void testReservedKeywordsMSSQLUseIndexIssue1325() throws JSQLParserExcept
"SELECT col FROM table USE INDEX(primary)", true);
}

@Test
public void testReservedKeywordsIssue1352() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(
"SELECT system from b1.system", true);
assertSqlCanBeParsedAndDeparsed(
"SELECT query from query.query", true);
assertSqlCanBeParsedAndDeparsed(
"SELECT fulltext from fulltext.fulltext", true);
}

@Test
public void testTableSpaceKeyword() throws JSQLParserException {
// without extra brackets
Expand Down

0 comments on commit a8afd9a

Please sign in to comment.