[jOOQ/jOOQ#10583] Loader API should pad input rows if more target fields are provided than source fields

This commit is contained in:
Lukas Eder 2020-09-03 13:04:15 +02:00
parent 4a8078c3d5
commit 622985ee5e

View File

@ -829,6 +829,10 @@ final class LoaderImpl<R extends Record> implements
if (fields[i].getType() == byte[].class && row[i] instanceof String)
row[i] = DatatypeConverter.parseBase64Binary((String) row[i]);
// [#10583] Pad row to the fields length
if (row.length < fields.length)
row = Arrays.copyOf(row, fields.length);
rowCtx.row(row);
if (onRowStart != null) {
onRowStart.row(rowCtx);