TDS doesn't always send a DonePackage{Status: TDS_DONE_FINAL} as the final package in a query - which causes problems with procedures that execute other procedures and the way we consume packages.
E.g. the statement create proc proc1 from select "ping"; proc1 will send DonePackage{Status: TDS_DONE_INXACT} as the last package.
This package also occurs in the statement
create proc proc2 from
begin
proc1
proc1
end
proc1
But not at the last statement - here the DonePackage{TDS_DONE_INXACT} will occur twice for the two proc1 calls and the final package is a DonePackage{TDS_DONE_FINAL}.
This PR changes the tryParsePackage method so that the last package will always be a DonePackage{TDS_DONE_FINAL} or DonePackage{TDS_DONE_COUNT}.
Description
TDS doesn't always send a
DonePackage{Status: TDS_DONE_FINAL}
as the final package in a query - which causes problems with procedures that execute other procedures and the way we consume packages.E.g. the statement
create proc proc1 from select "ping"; proc1
will sendDonePackage{Status: TDS_DONE_INXACT}
as the last package. This package also occurs in the statementBut not at the last statement - here the
DonePackage{TDS_DONE_INXACT}
will occur twice for the twoproc1
calls and the final package is aDonePackage{TDS_DONE_FINAL}
.This PR changes the
tryParsePackage
method so that the last package will always be aDonePackage{TDS_DONE_FINAL}
orDonePackage{TDS_DONE_COUNT}
.Related issues
-
Tests