Skip to content

fix: replace partition key representations consistently - #2710

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/partition-key-state
Sep 25, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/partition-key-state

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Changing a parsed partition key from a single expression to an expression list or column list could leave the old expression active. For example, converting HASH(id) to KEY(other) rendered KEY(id), silently changing the intended result.

Make the partition key representations mutually exclusive through a shared state reset. Existing setters remain available, and setting an inactive representation to null preserves the active key. Regression tests cover PostgreSQL multiple/attributed keys and MySQL HASH/KEY transitions through both renderers.

Validation: full Gradle check and grammar ambiguity gate. Database-backed mutation checks compare the requested partition definition with PostgreSQL 18.6 and MySQL 9.7.2 / 26.7.0 catalogs.

Signed-off-by: minleejae <mmj9808@gmail.com>
@manticore-projects
manticore-projects merged commit 42d4670 into JSQLParser:master Sep 25, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Good cleanup, 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.

2 participants