[#7376] Internal FieldMapsForInsert.empty behaves incorrectly
This commit is contained in:
parent
dfdea8c3b0
commit
8965e98149
@ -77,14 +77,14 @@ final class FieldMapsForInsert extends AbstractQueryPart {
|
||||
private static final long serialVersionUID = -6227074228534414225L;
|
||||
|
||||
final Table<?> table;
|
||||
final List<Field<?>> empty;
|
||||
final Map<Field<?>, Field<?>> empty;
|
||||
final Map<Field<?>, List<Field<?>>> values;
|
||||
int rows;
|
||||
|
||||
FieldMapsForInsert(Table<?> table) {
|
||||
this.table = table;
|
||||
this.values = new LinkedHashMap<Field<?>, List<Field<?>>>();
|
||||
this.empty = new ArrayList<Field<?>>();
|
||||
this.empty = new LinkedHashMap<Field<?>, Field<?>>();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -230,8 +230,12 @@ final class FieldMapsForInsert extends AbstractQueryPart {
|
||||
|
||||
for (Object field : fields) {
|
||||
Field<?> f = Tools.tableField(table, field);
|
||||
Field<?> e = DSL.val(null, f);
|
||||
empty.add(e);
|
||||
Field<?> e = empty.get(f);
|
||||
|
||||
if (e == null) {
|
||||
e = DSL.val(null, f);
|
||||
empty.put(f, e);
|
||||
}
|
||||
|
||||
if (!values.containsKey(f)) {
|
||||
values.put(f, rows > 0
|
||||
@ -269,10 +273,11 @@ final class FieldMapsForInsert extends AbstractQueryPart {
|
||||
}
|
||||
|
||||
final void newRecord() {
|
||||
int i = 0;
|
||||
Iterator<List<Field<?>>> it1 = values.values().iterator();
|
||||
Iterator<Field<?>> it2 = empty.values().iterator();
|
||||
|
||||
for (List<Field<?>> list : values.values())
|
||||
list.add(empty.get(i++));
|
||||
while (it1.hasNext() && it2.hasNext())
|
||||
it1.next().add(it2.next());
|
||||
|
||||
rows++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user