diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.12.txt b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.12.txt index b6af32a32a..75e89dcbb8 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.12.txt +++ b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.12.txt @@ -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' ( diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 26494752f9..25e99e87fe 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -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"))