[#8503] Make SET clause in ON DUPLICATE KEY UPDATE optional in parser
jOOQ parses a synthetic SET clause which is not supported by MySQL. This clause must be parsed optionally
This commit is contained in:
parent
3f84ccf58f
commit
929529ec7a
@ -317,7 +317,7 @@ insertStatement =
|
||||
)
|
||||
break
|
||||
[
|
||||
'ON DUPLICATE KEY UPDATE' 'SET' setClauses [ 'WHERE' condition ]
|
||||
'ON DUPLICATE KEY UPDATE' [ 'SET' ] setClauses [ 'WHERE' condition ]
|
||||
| 'ON DUPLICATE KEY IGNORE'
|
||||
| 'ON CONFLICT' ( 'ON CONSTRAINT' constraintName | '(' fieldNames ')' ) 'DO'
|
||||
(
|
||||
|
||||
@ -1699,7 +1699,9 @@ final class ParserImpl implements Parser {
|
||||
throw ctx.expected("DEFAULT VALUES", "SELECT", "SET", "VALUES");
|
||||
|
||||
if (parseKeywordIf(ctx, "ON")) {
|
||||
if (parseKeywordIf(ctx, "DUPLICATE KEY UPDATE SET")) {
|
||||
if (parseKeywordIf(ctx, "DUPLICATE KEY UPDATE")) {
|
||||
parseKeywordIf(ctx, "SET");
|
||||
|
||||
InsertOnConflictWhereStep<?> where = onDuplicate.onDuplicateKeyUpdate().set(parseSetClauseList(ctx));
|
||||
|
||||
if (parseKeywordIf(ctx, "WHERE"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user