From 8d7c5d7b7c07cfcab87cac8f3b915ac23554b1eb Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 2 Oct 2023 09:31:07 +0200 Subject: [PATCH] [jOOQ/jOOQ#15632] OSS edition fix --- .../java/org/jooq/impl/InsertQueryImpl.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java index 42c9758e02..d2261c3f10 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java @@ -392,31 +392,31 @@ implements if ((onDuplicateKeyIgnore || onDuplicateKeyUpdate) && ctx.configuration().requireCommercial(() -> "InlineDerivedTable emulation for INSERT .. ON DUPLICATE KEY clauses is available in the commercial jOOQ editions only")) { - // [pro] */ - // [#15632] The i.condition may reference columns that aren't part of d.insertMaps, so - // we have to synthetically add explicit defaults for any known fields. - List> fields = (List) i.condition.$traverse(Traversers.findingAll(p -> p instanceof TableField tf - ? tf.getTable() == null || unalias(i.table).equals(unalias(tf.getTable())) - : false - )); - for (Field f : fields) { - if (!d.insertMaps.values.containsKey(f)) - d.addValue(f, (Field) f.getDataType().default_()); - } - // [#15632] Don't allow for values to be created that don't match the InlineDerivedTable or policy - Condition c, c2; - c = c2 = i.condition; - for (Entry e : d.updateMap.entrySet()) { - c2 = (Condition) c2.$replace(q -> e.getKey().equals(q) - ? (QueryPart) e.getValue() - : q - ); - } - if (c2 != c) - d.addConditions(c2); - /* [/pro] */ + + + + + + + + + + + + + + + + + + + + + + + } d.select =