GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix issue 2106: Add parsing functionality for MySQL ADD PARTITION and DROP PARTITION clauses in ALTER TABLE statements(2) by minleejae · Pull Request #2108 · JSQLParser/JSqlParser

Conversation

@minleejae

@minleejae minleejae commented Nov 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary
This PR addresses the issue #2016 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

  • Modified the parser to correctly identify and handle the ADD PARTITION clauses, including storage options, allowing for accurate parsing of these statements.
  • Added support for parsing DROP PARTITION clauses.
  • Refactored the TRUNCATE PARTITION parsing functionality.

References
MySQL Documentation: ALTER TABLE Partition Operations

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mj-db added 8 commits November 12, 2024 19:44
@mj-db
feat MySQL Alter add partition
b0d6f1b
@mj-db
fix PartitionDefinition to Serializable
d8203a3
@mj-db
Merge branch 'master' of https://github.com/minleejae/JSqlParser into…
bfa2acd
… feature/partition
@mj-db
add Engine variable to MySQL partition definition
34c8b11
@mj-db
fix: Update parser to correctly handle ENGINE token and pass existing…
0780720
… CREATE TABLE tests
@mj-db
feat mysql alter drop partition
dd70254
@mj-db
refactor truncate partition
5a10801
@mj-db
fix codacy
829da96
@minleejae

minleejae commented Nov 13, 2024

Copy link
Copy Markdown
Contributor Author

Hello,
I'm encountering a StackOverflowError during the compileJava task in the CI environment, as shown in the error log below. However, I haven't been able to reproduce this issue locally, I'd greatly appreciate your guidance.
Notably, this error did not occur before the fix Codacy commit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

manticore-projects added 3 commits November 14, 2024 07:40
@manticore-projects
fix: add LOOKAHEADs
8f12496
Signed-off-by: Andreas Reichel <[email protected]>
@manticore-projects
doc: mention running gradle check
58e863c
Signed-off-by: Andreas Reichel <[email protected]>
@manticore-projects
style: add license header
48306e8
Signed-off-by: Andreas Reichel <[email protected]>
@manticore-projects
manticore-projects merged commit 12952d6 into JSQLParser:master Nov 14, 2024
@manticore-projects

manticore-projects commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

Thank you for your contribution.
Unfortunately I have no idea yet what causes this Stack Overflow:

  1. I can't re-produce it locally
  2. It worked fine on GitHub one time, only to fail afterwards many times -- without any changes on the Java code
minleejae reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@minleejae

minleejae commented Nov 14, 2024

Copy link
Copy Markdown
Contributor Author

@manticore-projects
Thank you for checking into this. Could the StackOverflowError in the Gradle CI environment be due to an insufficient stack size? I’m not sure, but it might be the issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Nov 14, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Right now, my uneducated guess was about a build-caching issue because the builds succeed first time and then fail sub-sequentially. We will figure this out eventually.

For example, it just built perfectly fine after merge?!

minleejae reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

@minleejae: If you ever come to Thailand for a course of golf, please do let me know!

minleejae reacted with thumbs up emoji minleejae reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@minleejae

minleejae commented Nov 14, 2024

Copy link
Copy Markdown
Contributor Author

@manticore-projects
Thank you for the warm welcome!

Regarding the Gradle CI issue, it's possible that the errors we’re seeing might be related to build-caching inconsistencies, which makes it an interesting topic to look into further.

Additionally, I’m not very familiar with JavaCC syntax, I’m curious—does using LOOKAHEAD in JavaCC have any notable impact on performance compared to not using it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

Additionally, I’m not very familiar with JavaCC syntax, I’m curious—does using LOOKAHEAD in JavaCC have any notable impact on performance compared to not using it?

Yes, it does come with a performance penalty although you need to distinguish:

  1. a numeric LOOKAHEAD like LOOKAHEAD(2) is harmless because it will check the next 2 tokens only. In fact I have seen grammars that apply a default LOOKAHEAD(3) to just everything (JSQLParser's default is LOOKAHEAD(1))

  2. a semantic LOOKAHEAD is really expensive and must be avoided at all cost -- although we use it especially for FUNCTION. Unfortunately SQL is a terrible dialect by design with no clear blocks and to make things worse, JSQLParser has grown over 20+ years and also tries to be dialect agnostic. So we have no choice but to engage some functional lookahead -- even when you can actually break the parser with it. For this reason we have COMPLEX vs. SIMPLE parsing modes. All not very beautiful from a technical point of view, but in practice it just works most of the time.

minleejae reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@minleejae
minleejae deleted the feature/partition branch November 14, 2024 08:56
@manticore-projects manticore-projects mentioned this pull request Nov 14, 2024
[FEATURE] MySQL ADD PARTITION and DROP PARTITION Clauses in ALTER TABLE Statements Not Parsed Correctly by JSQLParser #2106
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@minleejae @manticore-projects @mj-db
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.