Skip to content

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
@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