#2774 - Postgres ANY / MultiValueSupport with byte[]/binary data

Tidy up MultiValueBind.toArray() only
This commit is contained in:
Rob Bygrave committed 2022-11-08 09:33:09 +13:00
1 parent fed4413259
commit 8966faeb7e
1 file changed
+1 -9
@@ -17,15 +17,7 @@ public class MultiValueBind {
} }
Object[] toArray(Collection<?> values, ScalarType<?> type) { Object[] toArray(Collection<?> values, ScalarType<?> type) {
if (type.binary()) { Object[] array = type.binary() ? new byte[values.size()][] : new Object[values.size()];
byte[][] array = new byte[values.size()][];
int i = 0;
for (Object value : values) {
array[i++] = (byte[])type.toJdbcType(value);
}
return array;
}
Object[] array = new Object[values.size()];
int i = 0; int i = 0;
for (Object value : values) { for (Object value : values) {
array[i++] = type.toJdbcType(value); array[i++] = type.toJdbcType(value);