From eb2682935bd86d0fcef970a6e4b1ad4157b10a65 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 24 Feb 2021 14:22:51 +0100 Subject: [PATCH] [jOOQ/jOOQ#5851] Make sure we have at least 1 data type --- jOOQ/src/main/java/org/jooq/impl/Values.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Values.java b/jOOQ/src/main/java/org/jooq/impl/Values.java index c33cecc50d..a0110bca82 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Values.java +++ b/jOOQ/src/main/java/org/jooq/impl/Values.java @@ -116,12 +116,16 @@ final class Values extends AbstractTable { typeLoop: for (int i = 0; i < types.length; i++) { - for (Row row : rows) { - DataType type = row.dataType(i); + types[i] = rows[0].dataType(i); - if (type.getType() != Object.class) { - types[i] = type; - continue typeLoop; + if (types[i].getType() == Object.class) { + for (int j = 1; j < rows.length; j++) { + DataType type = rows[j].dataType(i); + + if (type.getType() != Object.class) { + types[i] = type; + continue typeLoop; + } } } }