Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,7 @@ String NonReservedWord() :
| tk=<K_ENFORCED: "ENFORCED">
| tk=<K_ENGINE: "ENGINE">
| tk=<K_ERROR: "ERROR">
| tk=<K_ERRORS: "ERRORS">
| tk=<K_ESCAPE: "ESCAPE">
| tk=<K_EVENT: "EVENT">
| tk=<K_EVERY: "EVERY">
Expand Down Expand Up @@ -2866,7 +2867,6 @@ TOKEN: /* Reserved SQL Keywords and structural tokens */
| <K_DISTINCT:"DISTINCT">
| <K_DISTINCTROW:"DISTINCTROW">
| <K_ELSE:"ELSE">
| <K_ERRORS: "ERRORS">
| <K_EXCEPT: "EXCEPT">
| <K_EXCLUDES: "EXCLUDES"> /* Salesforce SOQL */
| <K_EXISTS:"EXISTS">
Expand Down
2 changes: 0 additions & 2 deletions src/site/sphinx/keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ The following Keywords are **reserved** in JSQLParser-|JSQLPARSER_VERSION| and m
+---------------------------+
| ELSE |
+---------------------------+
| ERRORS |
+---------------------------+
| EXCEPT |
+---------------------------+
| EXCLUDES |
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/net/sf/jsqlparser/statement/KeywordsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@ public void testGroupsAsIdentifier() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT a groups FROM mytable", true);
assertSqlCanBeParsedAndDeparsed("CREATE TABLE mytable (groups INT)", true);
}

// ERRORS introduces Exasol's IMPORT/EXPORT error clauses but is an ordinary name elsewhere,
// e.g. a DuckDB column holding the errors of an upstream step.
@Test
public void testErrorsAsIdentifier() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT errors FROM mytable", true);
assertSqlCanBeParsedAndDeparsed("SELECT t.errors AS errors FROM mytable t", true);
assertSqlCanBeParsedAndDeparsed("WITH errors AS (SELECT 1) SELECT * FROM errors", true);
assertSqlCanBeParsedAndDeparsed("CREATE TABLE mytable (errors VARCHAR)", true);
}
}
Loading