Skip to content
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

feat: Support FOR SHARE #1922

Merged
merged 5 commits into from
Dec 16, 2023

Conversation

jxnu-liguobin
Copy link
Contributor

close #1878
MySQL: FOR {UPDATE | SHARE}
PostgreSQL: FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE }

Copy link
Contributor

@manticore-projects manticore-projects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have concerns on this implementation, when building this statement with java code.

@@ -2268,13 +2269,19 @@ PlainSelect PlainSelect() #PlainSelect:
[ LOOKAHEAD(<K_LIMIT>, { limit==null }) limit = LimitWithOffset() { plainSelect.setLimit(limit); } ]
[ LOOKAHEAD(<K_FETCH>) fetch = Fetch() { plainSelect.setFetch(fetch); } ]
[ LOOKAHEAD(<K_WITH> <K_ISOLATION>) withIsolation = WithIsolation() { plainSelect.setIsolation(withIsolation); } ]
[ LOOKAHEAD(2) <K_FOR> <K_UPDATE> { plainSelect.setForUpdate(true); }
[ LOOKAHEAD(2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better, well done!

}

@Test
public void testIssue1878ViaJava() throws JSQLParserException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

@manticore-projects manticore-projects merged commit 815f875 into JSQLParser:master Dec 16, 2023
4 checks passed
@manticore-projects
Copy link
Contributor

Thank you a lot for providing this implementation!

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.

[mysql] FOR SHARE
2 participants