From 4f4cd5e63573da4d6edcc7d4213afaca67c19f88 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 23 Nov 2015 15:53:48 -0800 Subject: upgrading libs --- Godeps/_workspace/src/github.com/lib/pq/.travis.yml | 1 + Godeps/_workspace/src/github.com/lib/pq/bench_test.go | 2 +- Godeps/_workspace/src/github.com/lib/pq/buf.go | 3 ++- Godeps/_workspace/src/github.com/lib/pq/conn.go | 14 +++++++++++++- Godeps/_workspace/src/github.com/lib/pq/copy.go | 9 ++++----- Godeps/_workspace/src/github.com/lib/pq/encode.go | 2 +- Godeps/_workspace/src/github.com/lib/pq/encode_test.go | 12 ++++++------ .../_workspace/src/github.com/lib/pq/hstore/hstore_test.go | 2 +- Godeps/_workspace/src/github.com/lib/pq/oid/gen.go | 2 +- 9 files changed, 30 insertions(+), 17 deletions(-) (limited to 'Godeps/_workspace/src/github.com/lib/pq') diff --git a/Godeps/_workspace/src/github.com/lib/pq/.travis.yml b/Godeps/_workspace/src/github.com/lib/pq/.travis.yml index 9bf683730..6b8eb405b 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/.travis.yml +++ b/Godeps/_workspace/src/github.com/lib/pq/.travis.yml @@ -5,6 +5,7 @@ go: - 1.2 - 1.3 - 1.4 + - 1.5 - tip before_install: diff --git a/Godeps/_workspace/src/github.com/lib/pq/bench_test.go b/Godeps/_workspace/src/github.com/lib/pq/bench_test.go index e71f41d06..8ceadc69b 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/bench_test.go +++ b/Godeps/_workspace/src/github.com/lib/pq/bench_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "github.com/lib/pq/oid" + "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq/oid" ) var ( diff --git a/Godeps/_workspace/src/github.com/lib/pq/buf.go b/Godeps/_workspace/src/github.com/lib/pq/buf.go index e7ff57771..fd7a3c573 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/buf.go +++ b/Godeps/_workspace/src/github.com/lib/pq/buf.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/binary" - "github.com/lib/pq/oid" + "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq/oid" ) type readBuf []byte @@ -21,6 +21,7 @@ func (b *readBuf) oid() (n oid.Oid) { return } +// N.B: this is actually an unsigned 16-bit integer, unlike int32 func (b *readBuf) int16() (n int) { n = int(binary.BigEndian.Uint16(*b)) *b = (*b)[2:] diff --git a/Godeps/_workspace/src/github.com/lib/pq/conn.go b/Godeps/_workspace/src/github.com/lib/pq/conn.go index 40a630d74..7b9aa5dc9 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/conn.go +++ b/Godeps/_workspace/src/github.com/lib/pq/conn.go @@ -22,7 +22,7 @@ import ( "time" "unicode" - "github.com/lib/pq/oid" + "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq/oid" ) // Common error types @@ -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 diff --git a/Godeps/_workspace/src/github.com/lib/pq/copy.go b/Godeps/_workspace/src/github.com/lib/pq/copy.go index e44fa48a5..101f11133 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/copy.go +++ b/Godeps/_workspace/src/github.com/lib/pq/copy.go @@ -215,9 +215,7 @@ func (ci *copyin) Exec(v []driver.Value) (r driver.Result, err error) { } if len(v) == 0 { - err = ci.Close() - ci.closed = true - return nil, err + return nil, ci.Close() } numValues := len(v) @@ -240,9 +238,10 @@ func (ci *copyin) Exec(v []driver.Value) (r driver.Result, err error) { } func (ci *copyin) Close() (err error) { - if ci.closed { - return errCopyInClosed + if ci.closed { // Don't do anything, we're already closed + return nil } + ci.closed = true if ci.cn.bad { return driver.ErrBadConn diff --git a/Godeps/_workspace/src/github.com/lib/pq/encode.go b/Godeps/_workspace/src/github.com/lib/pq/encode.go index 88422eb3d..a09f1a164 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/encode.go +++ b/Godeps/_workspace/src/github.com/lib/pq/encode.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/lib/pq/oid" + "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq/oid" ) func binaryEncode(parameterStatus *parameterStatus, x interface{}) []byte { diff --git a/Godeps/_workspace/src/github.com/lib/pq/encode_test.go b/Godeps/_workspace/src/github.com/lib/pq/encode_test.go index 97b663886..3e2f490d7 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/encode_test.go +++ b/Godeps/_workspace/src/github.com/lib/pq/encode_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/lib/pq/oid" + "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq/oid" ) func TestScanTimestamp(t *testing.T) { @@ -468,11 +468,11 @@ func TestBinaryByteSlicetoUUID(t *testing.T) { db := openTestConn(t) defer db.Close() - b := []byte{'\xa0','\xee','\xbc','\x99', - '\x9c', '\x0b', - '\x4e', '\xf8', - '\xbb', '\x00', '\x6b', - '\xb9', '\xbd', '\x38', '\x0a', '\x11'} + b := []byte{'\xa0', '\xee', '\xbc', '\x99', + '\x9c', '\x0b', + '\x4e', '\xf8', + '\xbb', '\x00', '\x6b', + '\xb9', '\xbd', '\x38', '\x0a', '\x11'} row := db.QueryRow("SELECT $1::uuid", b) var result string diff --git a/Godeps/_workspace/src/github.com/lib/pq/hstore/hstore_test.go b/Godeps/_workspace/src/github.com/lib/pq/hstore/hstore_test.go index c9c108fc3..219ba6626 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/hstore/hstore_test.go +++ b/Godeps/_workspace/src/github.com/lib/pq/hstore/hstore_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - _ "github.com/lib/pq" + _ "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq" ) type Fatalistic interface { diff --git a/Godeps/_workspace/src/github.com/lib/pq/oid/gen.go b/Godeps/_workspace/src/github.com/lib/pq/oid/gen.go index cd4aea808..d59942047 100644 --- a/Godeps/_workspace/src/github.com/lib/pq/oid/gen.go +++ b/Godeps/_workspace/src/github.com/lib/pq/oid/gen.go @@ -11,7 +11,7 @@ import ( "os" "os/exec" - _ "github.com/lib/pq" + _ "github.com/mattermost/platform/Godeps/_workspace/src/github.com/lib/pq" ) func main() { -- cgit v1.2.3-1-g7c22