-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ordering of message queue messages #723
base: master
Are you sure you want to change the base?
Fix ordering of message queue messages #723
Conversation
Codecov Report
@@ Coverage Diff @@
## master #723 +/- ##
==========================================
- Coverage 71.29% 71.21% -0.09%
==========================================
Files 24 24
Lines 5386 5412 +26
==========================================
+ Hits 3840 3854 +14
- Misses 1301 1312 +11
- Partials 245 246 +1
Continue to review full report at Codecov.
|
@@ -1145,6 +1147,10 @@ func (rc *Rowsq) Next(dest []driver.Value) error { | |||
if tok == nil { | |||
return io.EOF | |||
} else { | |||
switch tokdata := tok.(type) { | |||
case doneInProcStruct: | |||
tok = (doneStruct)(tokdata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a more idiomatic way to combine the handling of doneInProcStruct
and doneStruct
?
@kardianos hi can you look at this one? I need it to unblock go-sqlcmd. thx |
In order to keep the reader channel unblocked we have to handle every
done
anddoneInProc
token by sending aMsgNextResult
.I am tempted to combine the token read and switch statements in
rowsQ.NextResult
androwsQ.Next
into a common helper but I don't think it will add much value. Also, as TDS evolves, they may need to diverge in behavior at some point. As written, it's fairly clear which token types each function expects to see in the stream.