denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.81k stars 493 forks source link

Fix ordering of message queue messages #723

Open shueybubbles opened 2 years ago

shueybubbles commented 2 years ago

In order to keep the reader channel unblocked we have to handle every done and doneInProc token by sending a MsgNextResult.

I am tempted to combine the token read and switch statements in rowsQ.NextResult and rowsQ.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.

codecov[bot] commented 2 years ago

Codecov Report

Merging #723 (fafb9d9) into master (e538731) will decrease coverage by 0.08%. The diff coverage is 63.41%.

@@            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     
Impacted Files Coverage Δ
mssql.go 86.82% <53.57%> (-0.93%) :arrow_down:
token.go 64.67% <84.61%> (+0.45%) :arrow_up:
tds.go 65.49% <0.00%> (-0.37%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e538731...fafb9d9. Read the comment docs.

shueybubbles commented 2 years ago

@kardianos hi can you look at this one? I need it to unblock go-sqlcmd.

thx