diff --git a/src/remote/interface.cpp b/src/remote/interface.cpp index a1139928a3..b609a505f9 100644 --- a/src/remote/interface.cpp +++ b/src/remote/interface.cpp @@ -1936,7 +1936,6 @@ ISC_STATUS GDS_DSQL_FETCH(ISC_STATUS* user_status, if (statement->rsr_flags.test(Rsr::STREAM_ERR)) { - // The previous batch of receives ended with an error status. // We're all done returning data in the local queue. // Return that error status vector to the user. @@ -1947,14 +1946,7 @@ ISC_STATUS GDS_DSQL_FETCH(ISC_STATUS* user_status, // hvlad: prevent subsequent fetches statement->rsr_flags.set(Rsr::EOF_SET | Rsr::PAST_EOF); - - if (statement->rsr_status) - { - memcpy(user_status, statement->rsr_status->value(), sizeof(ISC_STATUS_ARRAY)); - // don't clear rsr_status as it hold strings - } - - return user_status[1]; + statement->raiseException(); } } statement->rsr_msgs_waiting--; @@ -2022,6 +2014,9 @@ ISC_STATUS GDS_DSQL_FREE(ISC_STATUS* user_status, Rsr** stmt_handle, USHORT opti return unsupported(user_status); } + fb_assert(statement->haveException() == 0); + statement->clearException(); + if (statement->rsr_flags.test(Rsr::LAZY)) { if (option == DSQL_drop)