Skip to content

Fix issue 2106: Add parsing functionality for MySQL ADD PARTITION and DROP PARTITION clauses in ALTER TABLE statements #2107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

minleejae
Copy link
Contributor

Summary
This PR addresses the issue with JSQLParser's inability to parse ADD PARTITION clauses in ALTER TABLE statements for MySQL 8.0. Previously, these clauses were not recognized, causing parsing errors for certain ALTER TABLE operations.

Changes

  • Updated AlterOperation enum to include ADD PARTITION.
  • Modified the parser to correctly identify and handle the ADD PARTITION clauses, allowing for accurate parsing of these statements.

References
MySQL Documentation: ALTER TABLE Partition Operations

Note
This update enables JSQLParser to parse MySQL 8.0-specific partition operations within ALTER TABLE statements, improving support for MySQL-specific syntax. Additional partition-related clauses (such as REORGANIZE PARTITION, REMOVE PARTITIONING, etc.) are planned for future implementation to fully support MySQL's ALTER TABLE partition syntax.

@manticore-projects
Copy link
Contributor

Thanks a lot, but please fix QA exceptions. I 'd like to advise to run gradle check before submitting. Cheers!

@minleejae
Copy link
Contributor Author

@manticore-projects
Hello, I think it would be helpful to include these steps in the contribution guide.
Adding instructions on running ./gradlew :spotlessApply for code formatting and gradle check for QA checks could improve the submission process and help contributors avoid similar issues. Including these steps in the contribution guidelines would make it easier for everyone to ensure code quality and consistency.

@manticore-projects manticore-projects merged commit 7b0e42f into JSQLParser:master Nov 12, 2024
3 checks passed
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