[jOOQ/jOOQ#2682] [jOOQ/jOOQ#15632] InsertQueryImpl::estimatedRowCount

When there is an inline derived table in an INSERT statement, then the
estimated row count should be unknown as we'll generate an INSERT ..
SELECT, with potentially 0 rows. When rendering the query, the
InsertQueryImpl.select property isn't null, due to a transformation, but
when executing the query, it's null.
This commit is contained in:
Lukas Eder 2023-11-20 10:57:31 +01:00
parent 0788e38d6b
commit baa7433173
3 changed files with 9 additions and 13 deletions

View File

@ -291,7 +291,7 @@ abstract class AbstractDMLQuery<R extends Record> extends AbstractRowCountQuery
return table;
}
final Table<?> table(Context<?> ctx) {
final Table<?> table(Scope ctx) {

View File

@ -43,25 +43,15 @@ import static org.jooq.impl.DSL.table;
import static org.jooq.impl.Tools.anyMatch;
import static org.jooq.tools.StringUtils.defaultIfNull;
import java.util.List;
import org.jooq.Check;
import org.jooq.Condition;
import org.jooq.Context;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Index;
import org.jooq.QueryPart;
import org.jooq.Record;
// ...
import org.jooq.Scope;
import org.jooq.Select;
import org.jooq.Table;
import org.jooq.TableField;
// ...
import org.jooq.UniqueKey;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Lukas Eder
@ -212,7 +202,7 @@ final class InlineDerivedTable<R extends Record> extends DerivedTable<R> {
return table;
}
static final <R extends Record> Table<R> inlineDerivedTable(Context<?> ctx, Table<R> t) {
static final <R extends Record> Table<R> inlineDerivedTable(Scope ctx, Table<R> t) {

View File

@ -1215,6 +1215,12 @@ implements