Repository navigation
Conversation
This was referenced Oct 12, 2026
minleejae
force-pushed
the
refactor/ddl-active-traversal-20261011
branch
from
October 13, 2026 03:32
2bdcea0 to
6c00a12
Compare
Contributor
|
Sorry, conflict. |
Signed-off-by: minleejae <mmj9808@gmail.com>
minleejae
force-pushed
the
refactor/ddl-active-traversal-20261011
branch
from
October 14, 2026 07:50
6c00a12 to
196cb60
Compare
This was referenced Oct 14, 2026
This branch has not been deployed
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.
Purpose
Make table discovery and metadata validation follow the DDL body actually rendered after AST mutation. For example, adding a column to an ALTER action that still stores an earlier foreign key renders
ADD added INT, but currently table discovery and validation still use the inactive foreign table and key columns.Current design (As-is)
Rendering selects one body, while traversal and metadata validation independently visit stored definitions, defaults and column options. This leaks inactive state into consumers. A CHECK option changed to FOREIGN_OPTIONS can also retain its old constraint node and incorrectly traverse that expression.
Target design (To-be)
getActiveTableDefinition()and the body-selection hooks introduced in Fix ALTER deparser dispatch for inactive column metadata #2770.ColumnOption.Kind, partial legacy constraint headers, identity actions and dedicated primary-key/partition/relation bodies.This refactoring changes consumer behavior after AST mutation; it adds no SQL syntax or database validity rules.
Rebase
#2770, which this PR previously included, and #2776 are now merged. The branch is rebased onto
master(bdf8ac31) and contains only its own commit.AlterValidator.validateIndexkeeps both changes. Fix index definition and reference roles in ALTER validation #2776's role-based name checks (the old name ofRENAME INDEX/KEYmust exist; a name introduced byADDorRENAMEis not looked up) apply when the index is the active definition or the action is a rename. Key columns are validated only for the active index definition.Validation
spotlessApply checkafter rebasing ontomaster(bdf8ac31): 10,368 tests, 10,343 passed, 25 skipped, zero failures/errors. Grammar, Checkstyle, PMD, SpotBugs and coverage checks pass.066f581e): existing findings decrease from 13 to 8, with no new findings or suppression/threshold changes.Integration validation
Applied #2770, #2771 and all four follow-ups (#2775–#2778) together on
master(066f581e), resolving overlapping validator edits while preserving their respective behavior. The integrated build passes Java 17 offline GradlespotlessApply check: 10,141 tests, 10,116 passed, 25 skipped, zero failures/errors. The combined ALTER validator has zero findings under the default PMD complexity and field-placement rules.Replayed 882 previously DB-validated MySQL/PostgreSQL DDL fixtures: 875 pass and the same seven existing parse gaps remain. SQL output, reparsing and AST node-type sets match the preceding integration baseline, with no new differences. This replay did not rerun the databases.
The published head passes grammar checks, Gradle and Maven on Ubuntu/Windows/macOS, and Codacy. Deployment-only jobs are skipped as expected for a PR.