Skip to content

Conversation

minleejae
Copy link
Contributor

Description

This PR adds support for the following MySQL-compatible ALTER TABLE syntax:

ALTER TABLE tbl_name [DEFAULT] COLLATE [=] collation_name

Changes

  • Updated JavaCC grammar to recognize [DEFAULT] COLLATE [=] collation_name as a valid ALTER TABLE clause

  • Introduced a new AlterOperation.COLLATE operation to distinguish this clause from CONVERT TO CHARACTER SET ...

  • Added defaultCollateSpecified and hasEqualForCollate flags to AlterExpression to track optional parts of the syntax

  • Modified toString() in AlterExpression to deparse the new syntax correctly

@manticore-projects
Copy link
Contributor

Well done and thank you!

@manticore-projects manticore-projects merged commit 48d195b into JSQLParser:master Mar 25, 2025
3 of 4 checks passed
@minleejae minleejae deleted the fix/collate branch April 2, 2025 09:16
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