-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: Support FOR SHARE
#1922
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!
Thank you a lot for providing this implementation! |
close #1878
MySQL:
FOR {UPDATE | SHARE}
PostgreSQL:
FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE }