Skip to content

Commit 70eaf53

Browse files
committed
Combine conditions as requested
1 parent f727114 commit 70eaf53

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/dsql/DsqlRequests.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -595,29 +595,25 @@ void DsqlDmlRequest::doExecute(thread_db* tdbb, jrd_tra** traHandle,
595595
JRD_receive(tdbb, request, message->msg_number, outMsgLength, outMsg);
596596

597597
// if this is a singleton select that return some data, make sure there's in fact one record
598-
599-
if (singleton)
598+
if (singleton && outMsgLength > 0)
600599
{
601-
if (outMsgLength > 0)
600+
// No record returned though expected
601+
if (!(request->req_flags & req_active))
602602
{
603-
// No record returned though expected
604-
if (!(request->req_flags & req_active))
605-
{
606-
status_exception::raise(Arg::Gds(isc_stream_eof));
607-
}
603+
status_exception::raise(Arg::Gds(isc_stream_eof));
604+
}
608605

609-
// Create a temp message buffer and try one more receive.
610-
// If it succeed then the next record exists.
606+
// Create a temp message buffer and try one more receive.
607+
// If it succeed then the next record exists.
611608

612-
HalfStaticArray<UCHAR, BUFFER_SMALL> message_buffer(getPool(), outMsgLength);
609+
HalfStaticArray<UCHAR, BUFFER_SMALL> message_buffer(getPool(), outMsgLength);
613610

614-
JRD_receive(tdbb, request, message->msg_number, outMsgLength, message_buffer.begin());
611+
JRD_receive(tdbb, request, message->msg_number, outMsgLength, message_buffer.begin());
615612

616-
// Still active request means that second record exists
617-
if ((request->req_flags & req_active))
618-
{
619-
status_exception::raise(Arg::Gds(isc_sing_select_err));
620-
}
613+
// Still active request means that second record exists
614+
if ((request->req_flags & req_active))
615+
{
616+
status_exception::raise(Arg::Gds(isc_sing_select_err));
621617
}
622618
}
623619
}

0 commit comments

Comments
 (0)