2
0

Fix fastpath / largeobjects query counting

fastpath.Call was not incrementing pendingReadyForQueryCount when it
sent a function call. But it was being decremented when the function
call was finished and the server sent the ready for query message. This
caused pendingReadyForQueryCount to go negative. This meant that any
subsequent activity that depended on ensureConnectionReadyForQuery would
not operate correctly because the connection would be considered ready
before it had read all previous data off the wire.

fixes #403
This commit is contained in:
Jack Christensen
2018-03-31 11:11:48 -05:00
parent 8ce528626e
commit b72ebe050f
2 changed files with 146 additions and 0 deletions
+2
View File
@@ -76,6 +76,8 @@ func (f *fastpath) Call(oid pgtype.OID, args []fpArg) (res []byte, err error) {
return nil, err
}
f.cn.pendingReadyForQueryCount++
for {
msg, err := f.cn.rxMsg()
if err != nil {