JSqlParser
JSqlParser copied to clipboard
Can support "FOR UPDATE SKIP LOCKED"?
It seems not support "SKIP LOCKED". The following two SQL can execute normally in MySql8, but parse failed by JSqlParser.
SELECT * FROM t_user FOR UPDATE SKIP LOCKED;
SELECT * FROM t_user FOR UPDATE OF t_user SKIP LOCKED;
Caused by: java.util.concurrent.ExecutionException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SKIP" "SKIP"
at line 1, column 35.
Was expecting one of:
";"
"NOWAIT"
"OF"
<EOF>
Can JSqlParser add support for "SKIP LOCKED"?
PostgreSQL also supports this (unfortunately, I don't have any SQL standard grammars > 2003 so I can't check when it was added. It did not exist in sql2003.
Hi. I've implemented the support for SKIP LOCKED tokens through the PR above. Can anyone check it and let me know if everything is OK?
Seems OK. I merged it. Use as a final commit something like fixes #issue then the issue will be closed automatically after merge.
Hi @wumpz, thanks for the review, merge and the feedback on the commit message.