You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a procedure that returns both a status code and a recordset, e.g.
ALTER procedure [dbo].[LoadConfigs]
as
set nocount on
select
[IdConfig],
[Value]
from dbo.Config
return 101
called as
var rs mssql.ReturnStatus
rows, err := db.QueryContext(ctx, "theproc", &rs)
if err != nil {
return err
}
if rs != 0 {
return errors.New("SP returned non-zero status")
}
for rows.Next() {
err = rows.Scan(&val)
//Do stuff with val
}
we are expecting that the return status will be set immediately after QueryContext returns with no errors (based on the implementation in mssql.go, processQueryResponse())
What we are observing is that the return status remains zero because processQueryResponse() breaks its parsing of tokens as soon as it encounters a []columnStruct token.
Note: Return status is then filled by Rows.Next() when it encounters a Return Status token.
The text was updated successfully, but these errors were encountered:
Given a procedure that returns both a status code and a recordset, e.g.
called as
we are expecting that the return status will be set immediately after QueryContext returns with no errors (based on the implementation in mssql.go, processQueryResponse())
What we are observing is that the return status remains zero because processQueryResponse() breaks its parsing of tokens as soon as it encounters a []columnStruct token.
Note: Return status is then filled by Rows.Next() when it encounters a Return Status token.
The text was updated successfully, but these errors were encountered: