Skip to content

fix: preserve qualified names in TABLE query output - #2660

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/table-query-qualified-output
Sep 21, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/table-query-qualified-output

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

TABLE db.t keeps the qualified table in its AST, but toString() currently emits TABLE t. When the current database contains another table named t, executing that output reads a different table. A MySQL fixture reproduced results changing from 29 to 17.

Use the existing Table renderer and share the TABLE prefix/body rendering with TableStatementDeParser. This preserves qualified and quoted names through both output paths and after AST mutations, including ORDER BY/LIMIT/OFFSET.

Syntax reference: MySQL TABLE.

Validation:

  • Full Gradle check passed on Java 17, including grammar ambiguity, formatting, static analysis, coverage and the full test suite. JUnit XML totals: 7812 tests, 0 failures/errors, 25 skipped.
  • MySQL 8.4.11: 4 cases (4 valid, 0 invalid). For all 4 valid cases, the original SQL, toString output and StatementDeParser output executed with identical results.

Signed-off-by: minleejae <mmj9808@gmail.com>
@manticore-projects
manticore-projects merged commit da969af into JSQLParser:master Sep 21, 2026
10 checks passed
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.

2 participants