From 10e85358733d658933ec657920110ceb35578636 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Fri, 10 Feb 2017 17:48:02 +0100 Subject: [PATCH] [#5453] Work around Oracle 12c issue with INSERT .. SELECT into tables with IDENTITY column --- .../java/org/jooq/impl/InsertQueryImpl.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java index 50b21d3636..fae7842a62 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java @@ -44,6 +44,7 @@ import static org.jooq.Clause.INSERT_RETURNING; import static org.jooq.Clause.INSERT_SELECT; import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; +// ... import static org.jooq.impl.DSL.select; import static org.jooq.impl.DSL.selectFrom; import static org.jooq.impl.DSL.selectOne; @@ -62,6 +63,7 @@ import org.jooq.Condition; import org.jooq.Configuration; import org.jooq.Context; import org.jooq.Field; +import org.jooq.Identity; import org.jooq.InsertQuery; import org.jooq.Merge; import org.jooq.MergeNotMatchedStep; @@ -420,6 +422,13 @@ final class InsertQueryImpl extends AbstractStoreQuery impl if (insertMaps.insertMaps.get(0).size() == 0) ctx.data(DATA_INSERT_SELECT_WITHOUT_INSERT_COLUMN_LIST, true); + + + + + + + ctx.formatSeparator() .start(INSERT_SELECT) .visit(select) @@ -460,11 +469,42 @@ final class InsertQueryImpl extends AbstractStoreQuery impl break; } } + + + + + + + + + else { ctx.visit(insertMaps); } } + + + + + + + + + + + + + + + + + + + + + + private final QueryPart toInsertSelect(Configuration configuration) { if (table.getPrimaryKey() != null) {