Skip to content

Commit 58d46fe

Browse files
committed
#848 Fetch response with status=FETCH_OK and count=0 is an expected response
(cherry picked from commit 268c858)
1 parent 769ebd7 commit 58d46fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/org/firebirdsql/gds/ng/wire/version10/V10Statement.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,16 @@ protected void processFetchResponse(FetchDirection direction, Response response)
447447
}
448448
do {
449449
if (!(response instanceof FetchResponse fetchResponse)) break;
450-
if (fetchResponse.count() > 0 && fetchResponse.status() == ISCConstants.FETCH_OK) {
450+
if (fetchResponse.status() == ISCConstants.FETCH_OK && fetchResponse.count() > 0) {
451+
// Received a row
451452
queueRowData(readSqlData());
452453
rowsFetched++;
454+
} else if (fetchResponse.status() == ISCConstants.FETCH_OK && fetchResponse.count() == 0) {
455+
// end of batch, but not end of cursor
456+
// Exit loop
457+
break;
453458
} else if (fetchResponse.status() == ISCConstants.FETCH_NO_MORE_ROWS) {
459+
// end of cursor
454460
switch (direction) {
455461
case IN_PLACE -> {
456462
if (isBeforeFirst()) {

0 commit comments

Comments
 (0)