[jOOQ/jOOQ#15582] MariaDB UPDATE .. RETURNING emulation should work on tables with unique constraints only
This commit is contained in:
parent
68dc0f4ce5
commit
9f1b86a1a0
@ -566,7 +566,13 @@ implements
|
||||
acceptFromAsMerge(ctx);
|
||||
return;
|
||||
}
|
||||
else if (!returning.isEmpty() && EMULATE_RETURNING_WITH_UPSERT.contains(ctx.dialect())) {
|
||||
else if (!returning.isEmpty()
|
||||
&& EMULATE_RETURNING_WITH_UPSERT.contains(ctx.dialect())
|
||||
&& table instanceof TableImpl
|
||||
|
||||
// [#15582] This implementation should be done only for plain SQL templates
|
||||
// or generated code with at least one known unique key
|
||||
&& (((TableImpl<?>) table).fields.fields.length == 0 || !table.getKeys().isEmpty())) {
|
||||
acceptReturningAsUpsert(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user