Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data access by field index is broken in PgRow. #31

Open
daemas opened this issue Oct 10, 2016 · 3 comments
Open

Data access by field index is broken in PgRow. #31

daemas opened this issue Oct 10, 2016 · 3 comments
Assignees
Labels

Comments

@daemas
Copy link

daemas commented Oct 10, 2016

PgRow's get***(int index) methods are broken because the order of columns is messed up in PgRow.columns and PgRow.pgColumns.

@daemas
Copy link
Author

daemas commented Oct 10, 2016

It worked for me in version 0.6, but after upgrading to a newer version it stopped working. I think this happened because of the replacement of LinkedHashMap with a HashMap in PgConnection class to store information about columns. LinkedHashMap guarantees the order of the inserted elements, while HashMap does not, according to Java specification.

@alaisi alaisi self-assigned this Oct 11, 2016
@alaisi alaisi added the bug label Oct 11, 2016
@RyanHoldren
Copy link

I can confirm @daemas findings. I was indeed able to fix this issue by changing the HashMap back to a LinkedHashMap in PgConnection.getColumns().

@RyanHoldren
Copy link

#51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants