Repository navigation
Fix editable key columns after clearing legacy names - #2775
Merged
manticore-projects merged 1 commit intoOct 13, 2026
Merged
manticore-projects merged 1 commit into
manticore-projects merged 1 commit into
Conversation
Signed-off-by: minleejae <mmj9808@gmail.com>
This was referenced Oct 12, 2026
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
Allow callers to clear an index or constraint's legacy column names and then repopulate its structured key list. Today
key.setColumnsNames(null)followed byaddColumns(...)throwsUnsupportedOperationException.Current design (As-is)
The shared
KeyColumnSource.setColumnsNames(null)installsCollections.emptyList(). Index, primary/unique key, foreign key and exclusion constraint nodes retain that list. Their fluent appenders expect an editable list, so null-clear behaves differently from an empty-name replacement.Target design (To-be)
Use an empty
ArrayListin the shared null-clear path. Both null and empty name lists clear the keys and leave them editable throughgetColumns()and the existingaddColumnsoverloads. The legacy accessor still returns a rendered snapshot; replacing names still creates opaque keys and discards prior element-specific options. Indexes and constraints remain separate types.Validation
toString()andStatementDeParserpreserve the restored SQL and key options; rendered statements reparse successfully.spotlessApply check: 10,045 tests, 10,020 passed, 25 skipped, zero failures/errors. Grammar, Checkstyle, PMD, SpotBugs and coverage checks pass.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.