Skip to content

Commit a8afd9a

Browse files
Issue1352 (#1353)
* 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 <[email protected]>
1 parent 388b7c3 commit a8afd9a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,9 @@ String RelObjectNameWithoutValue() :
16421642
| tk=<K_LOG> | tk=<K_DUMP> | tk=<K_FLUSH> | tk=<K_ACTIVE> | tk=<K_RESUME> | tk=<K_SWITCH> | tk=<K_SUSPEND>
16431643
| tk=<K_ARCHIVE> | tk=<K_QUIESCE> | tk=<K_HISTORY> | tk=<K_SHUTDOWN> | tk=<K_REGISTER> | tk=<K_UNQIESCE>
16441644
| tk=<K_RESTRICTED> | tk=<K_CHECKPOINT> | tk=<K_DISCONNECT>
1645-
1645+
| tk=<K_SYSTEM>
1646+
| tk=<K_QUERY>
1647+
| tk=<K_FULLTEXT>
16461648
| tk=<K_TABLESPACE>
16471649
)
16481650

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4821,6 +4821,16 @@ public void testReservedKeywordsMSSQLUseIndexIssue1325() throws JSQLParserExcept
48214821
"SELECT col FROM table USE INDEX(primary)", true);
48224822
}
48234823

4824+
@Test
4825+
public void testReservedKeywordsIssue1352() throws JSQLParserException {
4826+
assertSqlCanBeParsedAndDeparsed(
4827+
"SELECT system from b1.system", true);
4828+
assertSqlCanBeParsedAndDeparsed(
4829+
"SELECT query from query.query", true);
4830+
assertSqlCanBeParsedAndDeparsed(
4831+
"SELECT fulltext from fulltext.fulltext", true);
4832+
}
4833+
48244834
@Test
48254835
public void testTableSpaceKeyword() throws JSQLParserException {
48264836
// without extra brackets

0 commit comments

Comments
 (0)