diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/lib/pq/conn.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/lib/pq/conn.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/lib/pq/conn.go b/Godeps/_workspace/src/github.com/lib/pq/conn.go index 40a630d74..ce661d66e 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/conn.go +++ b/Godeps/_workspace/src/github.com/lib/pq/conn.go @@ -1369,6 +1369,10 @@ func (rs *rows) Next(dest []driver.Value) (err error) { return io.EOF case 'D': n := rs.rb.int16() + if err != nil { + conn.bad = true + errorf("unexpected DataRow after error %s", err) + } if n < len(dest) { dest = dest[:n] } @@ -1622,6 +1626,10 @@ func (cn *conn) readExecuteResponse(protocolState string) (res driver.Result, co t, r := cn.recv1() switch t { case 'C': + if err != nil { + cn.bad = true + errorf("unexpected CommandComplete after error %s", err) + } res, commandTag = cn.parseComplete(r.string()) case 'Z': cn.processReadyForQuery(r) @@ -1629,6 +1637,10 @@ func (cn *conn) readExecuteResponse(protocolState string) (res driver.Result, co case 'E': err = parseError(r) case 'T', 'D', 'I': + if err != nil { + cn.bad = true + errorf("unexpected %q after error %s", t, err) + } // ignore any results default: cn.bad = true |