Skip to content

Commit

Permalink
[postgrenosql] Read ResultSet was not iterated correctly. (#1376)
Browse files Browse the repository at this point in the history
The first ResultSet.next() call to test if the ResultSet was empty moved the cursor without adding the resulting row to the YCSB result callback.
  • Loading branch information
Rogério Pontes committed Nov 29, 2020
1 parent 49ce12a commit bee93f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ public Status read(String tableName, String key, Set<String> fields, Map<String,

if (result != null) {
if (fields == null){
while (resultSet.next()){
do{
String field = resultSet.getString(2);
String value = resultSet.getString(3);
result.put(field, new StringByteIterator(value));
}
}while (resultSet.next());
} else {
for (String field : fields) {
String value = resultSet.getString(field);
Expand Down

0 comments on commit bee93f2

Please sign in to comment.