Skip to content

Commit 13541b1

Browse files
committed
fix: only return false for next() if all have finished
1 parent a461c39 commit 13541b1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/MergedResultSet.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ boolean nextRow() throws Throwable {
210210
PartitionExecutorResult next;
211211
if ((next = queue.peek()) != null && !next.isFinished()) {
212212
// There's a valid result available. Return this quickly.
213-
return setNextRow(queue.remove());
213+
if (setNextRow(queue.remove())) {
214+
return true;
215+
}
214216
}
215217
// Block until the next row is available.
216218
next = queue.take();
@@ -220,7 +222,9 @@ boolean nextRow() throws Throwable {
220222
return false;
221223
}
222224
} else {
223-
return setNextRow(next);
225+
if (setNextRow(next)) {
226+
return true;
227+
}
224228
}
225229
}
226230
}

0 commit comments

Comments
 (0)