Skip to content

Conversation

minleejae
Copy link
Contributor

Summary
This PR fixes and enhances the parsing functionality for MySQL ALTER TABLE statements in JSQLParser. It now supports a wider variety of ALTER TABLE syntax, including FORCE, ENGINE, ALGORITHM, and LOCK options.

Changes
Updated AlterOperation enum to include FORCE, ENGINE, ALGORITHM, and LOCK.
Modified the parser to correctly identify and handle these clauses.

Example
The following ALTER TABLE statements are now correctly parsed:

ALTER TABLE my_table FORCE;
ALTER TABLE tbl_name FORCE, ENGINE=InnoDB, ALGORITHM=INPLACE, LOCK=NONE;

Issue Reference
This PR addresses issue #2118.

@manticore-projects
Copy link
Contributor

Thank you for your contribution. A great job much appreciated.

@manticore-projects manticore-projects merged commit 18c1a2c into JSQLParser:master Dec 9, 2024
3 checks passed
@minleejae minleejae deleted the feature/alter branch March 24, 2025 04:17
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.

3 participants