Closed shueybubbles closed 2 years ago
My earlier assertion about MsgNext isn't quite right.
We need to send MsgNextResult
for every type of doneStruct
and MsgNext
for every column set.
We're also missing handling of ServerError
and doneInProcStruct
This fix will also address https://github.com/microsoft/go-sqlcmd/issues/47
https://github.com/denisenkom/go-mssqldb/blob/e53873151a46af22b77fa010fc1485c31cbb38b1/messages_example_test.go#L46 The message queue example illustrates that the application waits for the first
MsgNext
event before callingRows.Next
.Today,
ProcessQueryResponse
doesn't post aMsgNext
event until the reader encounters column metadata. However, the reader channel only has a 5 token buffer, so if there are 5 tokens in the queue before it reaches any columns, the query blocks. PostingMsgNext
right away will nudge the app to read tokens in the channel.Exposed by a sqlcmd issue https://github.com/microsoft/go-sqlcmd/issues/48