[jOOQ/jOOQ#5851] Make sure we have at least 1 data type

This commit is contained in:
Lukas Eder 2021-02-24 14:22:51 +01:00
parent 7a99758319
commit eb2682935b

View File

@ -116,12 +116,16 @@ final class Values<R extends Record> extends AbstractTable<R> {
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;
}
}
}
}