Skip to content

Allow ERRORS as an unquoted identifier - #2781

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
guizmaii:fix/errors-non-reserved
Oct 13, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
guizmaii:fix/errors-non-reserved

Conversation

@guizmaii

@guizmaii guizmaii commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Allow ERRORS as an unquoted identifier again. 5.4 rejects queries using it as a name, e.g. SELECT errors FROM t or a WITH errors AS (...) CTE, which DuckDB, PostgreSQL and most databases accept. We hit it on real DuckDB queries: 142 of ~500 production queries use an errors column.

Cause

ERRORS was declared in the reserved keyword block when the Exasol IMPORT/EXPORT error clauses were added (#2256). Its only uses, ERRORS INTO ... and REJECT LIMIT n ERRORS, sit behind lookaheads.

Change

  • Move K_ERRORS into NonReservedWord(), next to ERROR.
  • Remove it from keywords.rst.
  • KeywordsTest#testErrorsAsIdentifier: column, qualified column, alias, CTE and table column names.

Validation

  • Java 17 Gradle check: 10,043 tests, zero failures/errors; Spotless, Checkstyle, PMD and SpotBugs pass.
  • ExportTest and ImportTest (246 tests, including the ERRORS INTO and REJECT LIMIT n ERRORS cases) pass unchanged.

Cc @manticore-projects

`ERRORS` was declared in the reserved keyword block when the Exasol IMPORT/EXPORT
error clauses were added (JSQLParser#2256), so 5.4 rejects queries using it as a name, e.g.
`SELECT errors FROM t` or a `WITH errors AS (...)` CTE, which DuckDB, PostgreSQL
and most databases accept.

Its only uses, `ERRORS INTO ...` and `REJECT LIMIT n ERRORS`, are behind
lookaheads, so it moves to the non-reserved keywords next to `ERROR`. The Exasol
IMPORT/EXPORT tests still pass.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@manticore-projects
manticore-projects merged commit cf6c83c into JSQLParser:master Oct 13, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants