Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DROP INDEX ix ON app.tcurrently puts the owner in raw parameter tokens, so consumers cannot obtain or rewrite it through aTablenode. Table discovery also reports the index name as a table. This exposes the explicit owner throughDrop.getTable()and makes visitors, validation and custom deparsers use it. Index names and DROP names with quoted dots retain their identifier components.DROP rendering is shared by
DropandDropDeParser. The legacygetParameters()still includesONand the table, but returns a snapshot when an owner is structured. Owner mutations update that snapshot and SQL output;addParameters()preserves the owner;setParameters()replaces the complete clause with raw tokens and clears the structured owner. MySQL ALGORITHM/LOCK order and optional equals signs are preserved.This covers the single-owner ON form used by MySQL and SQL Server. PostgreSQL DROP INDEX has no explicit owner, so
getTable()is null and table discovery does not invent one. SQL Server's multi-owner list and WITH options remain outside this change.Validation
Merged locally with fix: preserve PostgreSQL quoted names, numeric scales and comment literals #2638, feat: support additional PostgreSQL COMMENT targets #2639 and feat: structure column attributes and generated expressions #2641 without conflicts: 7,126 Gradle tests, zero failures/errors, 25 skipped; the grammar ambiguity check passed. All 193 new audit cases produced identical parser/rendering results in the combined build.
Full Gradle
check, including the JavaCC ambiguity gate, formatting, Checkstyle, PMD and SpotBugs: 6,919 tests, zero failures/errors, 25 skipped. Spotless ratchet pinned to base6312f9e5.EXPORT_TEST_TO_FILE=False mvn -B clean verify: 6,901 tests, zero failures/errors, 25 skipped.MySQL 8.4.11 and PostgreSQL 18.6 differential checks: 34 valid statements retained the same index-deletion result after parsing and both rendering paths; two malformed ON clauses were rejected by the parser and MySQL. Coverage includes quoted/qualified names, the quoted PRIMARY index and ALGORITHM/LOCK variants.
SQL Server bracketed and database-qualified owners, IF EXISTS, AST mutations, legacy setters, custom deparsing and statement boundaries are covered by regression tests. SQL Server was not executed locally.
This is independent of the general AST querying API discussed in #2620. Related PostgreSQL quoted-name fixes in #2638 remain applicable to other statement contexts.
Syntax references: MySQL DROP INDEX, SQL Server DROP INDEX, PostgreSQL DROP INDEX.