You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the parameter is of of Map interface type which means, one can not assume anything about the implementation. Therefore, more appropriate fix could be e.g. in the constructor of PgRow:
pgColumns = new PgColumn[row.getColumns().size()];
for (PgColumn col : row.getColumns().values()) {
pgColumns[col.index] = col;
}
The text was updated successfully, but these errors were encountered:
In: https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/impl/PgRow.java#L47
PgColumn[] pgColumns order might be different from PgColumn.index values which makes get...(int index) methods quite useless at the moment.
See example situation in debugger:

Unfortunately this issue can most likely re-produce by random, so I can not provide a particular test case that would always fail.
This is caused by relying on HashMap.values() order although the order is not the same as the order they are put into the Map by its contract. This issue could most likely be resolved by using LinkedHashMap in com.github.pgasync.impl.PgConnection#getColumns:
https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/impl/PgConnection.java#L187
However, the parameter is of of Map interface type which means, one can not assume anything about the implementation. Therefore, more appropriate fix could be e.g. in the constructor of PgRow:
The text was updated successfully, but these errors were encountered: