mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Update dependencies
This commit is contained in:
6
vendor/github.com/lib/pq/array.go
generated
vendored
6
vendor/github.com/lib/pq/array.go
generated
vendored
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
var typeByteSlice = reflect.TypeOf([]byte{})
|
||||
var typeDriverValuer = reflect.TypeOf((*driver.Valuer)(nil)).Elem()
|
||||
var typeSqlScanner = reflect.TypeOf((*sql.Scanner)(nil)).Elem()
|
||||
var typeSQLScanner = reflect.TypeOf((*sql.Scanner)(nil)).Elem()
|
||||
|
||||
// Array returns the optimal driver.Valuer and sql.Scanner for an array or
|
||||
// slice of any dimension.
|
||||
@@ -278,7 +278,7 @@ func (GenericArray) evaluateDestination(rt reflect.Type) (reflect.Type, func([]b
|
||||
// TODO calculate the assign function for other types
|
||||
// TODO repeat this section on the element type of arrays or slices (multidimensional)
|
||||
{
|
||||
if reflect.PtrTo(rt).Implements(typeSqlScanner) {
|
||||
if reflect.PtrTo(rt).Implements(typeSQLScanner) {
|
||||
// dest is always addressable because it is an element of a slice.
|
||||
assign = func(src []byte, dest reflect.Value) (err error) {
|
||||
ss := dest.Addr().Interface().(sql.Scanner)
|
||||
@@ -587,7 +587,7 @@ func appendArrayElement(b []byte, rv reflect.Value) ([]byte, string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
var del string = ","
|
||||
var del = ","
|
||||
var err error
|
||||
var iv interface{} = rv.Interface()
|
||||
|
||||
|
||||
83
vendor/github.com/lib/pq/conn.go
generated
vendored
83
vendor/github.com/lib/pq/conn.go
generated
vendored
@@ -27,12 +27,12 @@ var (
|
||||
ErrNotSupported = errors.New("pq: Unsupported command")
|
||||
ErrInFailedTransaction = errors.New("pq: Could not complete operation in a failed transaction")
|
||||
ErrSSLNotSupported = errors.New("pq: SSL is not enabled on the server")
|
||||
ErrSSLKeyHasWorldPermissions = errors.New("pq: Private key file has group or world access. Permissions should be u=rw (0600) or less.")
|
||||
ErrCouldNotDetectUsername = errors.New("pq: Could not detect default username. Please provide one explicitly.")
|
||||
ErrSSLKeyHasWorldPermissions = errors.New("pq: Private key file has group or world access. Permissions should be u=rw (0600) or less")
|
||||
ErrCouldNotDetectUsername = errors.New("pq: Could not detect default username. Please provide one explicitly")
|
||||
|
||||
errUnexpectedReady = errors.New("unexpected ReadyForQuery")
|
||||
errNoRowsAffected = errors.New("no RowsAffected available after the empty statement")
|
||||
errNoLastInsertId = errors.New("no LastInsertId available after the empty statement")
|
||||
errNoLastInsertID = errors.New("no LastInsertId available after the empty statement")
|
||||
)
|
||||
|
||||
type Driver struct{}
|
||||
@@ -131,7 +131,7 @@ type conn struct {
|
||||
}
|
||||
|
||||
// Handle driver-side settings in parsed connection string.
|
||||
func (c *conn) handleDriverSettings(o values) (err error) {
|
||||
func (cn *conn) handleDriverSettings(o values) (err error) {
|
||||
boolSetting := func(key string, val *bool) error {
|
||||
if value, ok := o[key]; ok {
|
||||
if value == "yes" {
|
||||
@@ -145,18 +145,18 @@ func (c *conn) handleDriverSettings(o values) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
err = boolSetting("disable_prepared_binary_result", &c.disablePreparedBinaryResult)
|
||||
err = boolSetting("disable_prepared_binary_result", &cn.disablePreparedBinaryResult)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = boolSetting("binary_parameters", &c.binaryParameters)
|
||||
err = boolSetting("binary_parameters", &cn.binaryParameters)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *conn) handlePgpass(o values) {
|
||||
func (cn *conn) handlePgpass(o values) {
|
||||
// if a password was supplied, do not process .pgpass
|
||||
if _, ok := o["password"]; ok {
|
||||
return
|
||||
@@ -229,10 +229,10 @@ func (c *conn) handlePgpass(o values) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *conn) writeBuf(b byte) *writeBuf {
|
||||
c.scratch[0] = b
|
||||
func (cn *conn) writeBuf(b byte) *writeBuf {
|
||||
cn.scratch[0] = b
|
||||
return &writeBuf{
|
||||
buf: c.scratch[:5],
|
||||
buf: cn.scratch[:5],
|
||||
pos: 1,
|
||||
}
|
||||
}
|
||||
@@ -310,9 +310,8 @@ func DialOpen(d Dialer, name string) (_ driver.Conn, err error) {
|
||||
u, err := userCurrent()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
o["user"] = u
|
||||
}
|
||||
o["user"] = u
|
||||
}
|
||||
|
||||
cn := &conn{
|
||||
@@ -698,7 +697,7 @@ var emptyRows noRows
|
||||
var _ driver.Result = noRows{}
|
||||
|
||||
func (noRows) LastInsertId() (int64, error) {
|
||||
return 0, errNoLastInsertId
|
||||
return 0, errNoLastInsertID
|
||||
}
|
||||
|
||||
func (noRows) RowsAffected() (int64, error) {
|
||||
@@ -840,16 +839,15 @@ func (cn *conn) query(query string, args []driver.Value) (_ *rows, err error) {
|
||||
rows.colNames, rows.colFmts, rows.colTyps = cn.readPortalDescribeResponse()
|
||||
cn.postExecuteWorkaround()
|
||||
return rows, nil
|
||||
} else {
|
||||
st := cn.prepareTo(query, "")
|
||||
st.exec(args)
|
||||
return &rows{
|
||||
cn: cn,
|
||||
colNames: st.colNames,
|
||||
colTyps: st.colTyps,
|
||||
colFmts: st.colFmts,
|
||||
}, nil
|
||||
}
|
||||
st := cn.prepareTo(query, "")
|
||||
st.exec(args)
|
||||
return &rows{
|
||||
cn: cn,
|
||||
colNames: st.colNames,
|
||||
colTyps: st.colTyps,
|
||||
colFmts: st.colFmts,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Implement the optional "Execer" interface for one-shot queries
|
||||
@@ -876,17 +874,16 @@ func (cn *conn) Exec(query string, args []driver.Value) (res driver.Result, err
|
||||
cn.postExecuteWorkaround()
|
||||
res, _, err = cn.readExecuteResponse("Execute")
|
||||
return res, err
|
||||
} else {
|
||||
// Use the unnamed statement to defer planning until bind
|
||||
// time, or else value-based selectivity estimates cannot be
|
||||
// used.
|
||||
st := cn.prepareTo(query, "")
|
||||
r, err := st.Exec(args)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return r, err
|
||||
}
|
||||
// Use the unnamed statement to defer planning until bind
|
||||
// time, or else value-based selectivity estimates cannot be
|
||||
// used.
|
||||
st := cn.prepareTo(query, "")
|
||||
r, err := st.Exec(args)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return r, err
|
||||
}
|
||||
|
||||
func (cn *conn) send(m *writeBuf) {
|
||||
@@ -1147,10 +1144,10 @@ const formatText format = 0
|
||||
const formatBinary format = 1
|
||||
|
||||
// One result-column format code with the value 1 (i.e. all binary).
|
||||
var colFmtDataAllBinary []byte = []byte{0, 1, 0, 1}
|
||||
var colFmtDataAllBinary = []byte{0, 1, 0, 1}
|
||||
|
||||
// No result-column format codes (i.e. all text).
|
||||
var colFmtDataAllText []byte = []byte{0, 0}
|
||||
var colFmtDataAllText = []byte{0, 0}
|
||||
|
||||
type stmt struct {
|
||||
cn *conn
|
||||
@@ -1515,7 +1512,7 @@ func (cn *conn) sendBinaryModeQuery(query string, args []driver.Value) {
|
||||
cn.send(b)
|
||||
}
|
||||
|
||||
func (c *conn) processParameterStatus(r *readBuf) {
|
||||
func (cn *conn) processParameterStatus(r *readBuf) {
|
||||
var err error
|
||||
|
||||
param := r.string()
|
||||
@@ -1526,13 +1523,13 @@ func (c *conn) processParameterStatus(r *readBuf) {
|
||||
var minor int
|
||||
_, err = fmt.Sscanf(r.string(), "%d.%d.%d", &major1, &major2, &minor)
|
||||
if err == nil {
|
||||
c.parameterStatus.serverVersion = major1*10000 + major2*100 + minor
|
||||
cn.parameterStatus.serverVersion = major1*10000 + major2*100 + minor
|
||||
}
|
||||
|
||||
case "TimeZone":
|
||||
c.parameterStatus.currentLocation, err = time.LoadLocation(r.string())
|
||||
cn.parameterStatus.currentLocation, err = time.LoadLocation(r.string())
|
||||
if err != nil {
|
||||
c.parameterStatus.currentLocation = nil
|
||||
cn.parameterStatus.currentLocation = nil
|
||||
}
|
||||
|
||||
default:
|
||||
@@ -1540,8 +1537,8 @@ func (c *conn) processParameterStatus(r *readBuf) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *conn) processReadyForQuery(r *readBuf) {
|
||||
c.txnStatus = transactionStatus(r.byte())
|
||||
func (cn *conn) processReadyForQuery(r *readBuf) {
|
||||
cn.txnStatus = transactionStatus(r.byte())
|
||||
}
|
||||
|
||||
func (cn *conn) readReadyForQuery() {
|
||||
@@ -1556,9 +1553,9 @@ func (cn *conn) readReadyForQuery() {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *conn) processBackendKeyData(r *readBuf) {
|
||||
c.processID = r.int32()
|
||||
c.secretKey = r.int32()
|
||||
func (cn *conn) processBackendKeyData(r *readBuf) {
|
||||
cn.processID = r.int32()
|
||||
cn.secretKey = r.int32()
|
||||
}
|
||||
|
||||
func (cn *conn) readParseResponse() {
|
||||
|
||||
28
vendor/github.com/lib/pq/conn_test.go
generated
vendored
28
vendor/github.com/lib/pq/conn_test.go
generated
vendored
@@ -136,7 +136,7 @@ func TestOpenURL(t *testing.T) {
|
||||
testURL("postgresql://")
|
||||
}
|
||||
|
||||
const pgpass_file = "/tmp/pqgotest_pgpass"
|
||||
const pgpassFile = "/tmp/pqgotest_pgpass"
|
||||
|
||||
func TestPgpass(t *testing.T) {
|
||||
if os.Getenv("TRAVIS") != "true" {
|
||||
@@ -172,10 +172,10 @@ func TestPgpass(t *testing.T) {
|
||||
txn.Rollback()
|
||||
}
|
||||
testAssert("", "ok", "missing .pgpass, unexpected error %#v")
|
||||
os.Setenv("PGPASSFILE", pgpass_file)
|
||||
os.Setenv("PGPASSFILE", pgpassFile)
|
||||
testAssert("host=/tmp", "fail", ", unexpected error %#v")
|
||||
os.Remove(pgpass_file)
|
||||
pgpass, err := os.OpenFile(pgpass_file, os.O_RDWR|os.O_CREATE, 0644)
|
||||
os.Remove(pgpassFile)
|
||||
pgpass, err := os.OpenFile(pgpassFile, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error writing pgpass file %#v", err)
|
||||
}
|
||||
@@ -213,7 +213,7 @@ localhost:*:*:*:pass_C
|
||||
// wrong permissions for the pgpass file means it should be ignored
|
||||
assertPassword(values{"host": "example.com", "user": "foo"}, "")
|
||||
// fix the permissions and check if it has taken effect
|
||||
os.Chmod(pgpass_file, 0600)
|
||||
os.Chmod(pgpassFile, 0600)
|
||||
assertPassword(values{"host": "server", "dbname": "some_db", "user": "some_user"}, "pass_A")
|
||||
assertPassword(values{"host": "example.com", "user": "foo"}, "pass_fallback")
|
||||
assertPassword(values{"host": "example.com", "dbname": "some_db", "user": "some_user"}, "pass_B")
|
||||
@@ -221,7 +221,7 @@ localhost:*:*:*:pass_C
|
||||
assertPassword(values{"host": "", "user": "some_user"}, "pass_C")
|
||||
assertPassword(values{"host": "/tmp", "user": "some_user"}, "pass_C")
|
||||
// cleanup
|
||||
os.Remove(pgpass_file)
|
||||
os.Remove(pgpassFile)
|
||||
os.Setenv("PGPASSFILE", "")
|
||||
}
|
||||
|
||||
@@ -393,8 +393,8 @@ func TestEmptyQuery(t *testing.T) {
|
||||
if _, err := res.RowsAffected(); err != errNoRowsAffected {
|
||||
t.Fatalf("expected %s, got %v", errNoRowsAffected, err)
|
||||
}
|
||||
if _, err := res.LastInsertId(); err != errNoLastInsertId {
|
||||
t.Fatalf("expected %s, got %v", errNoLastInsertId, err)
|
||||
if _, err := res.LastInsertId(); err != errNoLastInsertID {
|
||||
t.Fatalf("expected %s, got %v", errNoLastInsertID, err)
|
||||
}
|
||||
rows, err := db.Query("")
|
||||
if err != nil {
|
||||
@@ -425,8 +425,8 @@ func TestEmptyQuery(t *testing.T) {
|
||||
if _, err := res.RowsAffected(); err != errNoRowsAffected {
|
||||
t.Fatalf("expected %s, got %v", errNoRowsAffected, err)
|
||||
}
|
||||
if _, err := res.LastInsertId(); err != errNoLastInsertId {
|
||||
t.Fatalf("expected %s, got %v", errNoLastInsertId, err)
|
||||
if _, err := res.LastInsertId(); err != errNoLastInsertID {
|
||||
t.Fatalf("expected %s, got %v", errNoLastInsertID, err)
|
||||
}
|
||||
rows, err = stmt.Query()
|
||||
if err != nil {
|
||||
@@ -1053,16 +1053,16 @@ func TestIssue282(t *testing.T) {
|
||||
db := openTestConn(t)
|
||||
defer db.Close()
|
||||
|
||||
var search_path string
|
||||
var searchPath string
|
||||
err := db.QueryRow(`
|
||||
SET LOCAL search_path TO pg_catalog;
|
||||
SET LOCAL search_path TO pg_catalog;
|
||||
SHOW search_path`).Scan(&search_path)
|
||||
SHOW search_path`).Scan(&searchPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if search_path != "pg_catalog" {
|
||||
t.Fatalf("unexpected search_path %s", search_path)
|
||||
if searchPath != "pg_catalog" {
|
||||
t.Fatalf("unexpected search_path %s", searchPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
6
vendor/github.com/lib/pq/encode_test.go
generated
vendored
6
vendor/github.com/lib/pq/encode_test.go
generated
vendored
@@ -370,17 +370,17 @@ func TestInfinityTimestamp(t *testing.T) {
|
||||
t.Errorf("Scanning -infinity, expected time %q, got %q", y1500, resultT.String())
|
||||
}
|
||||
|
||||
y_1500 := time.Date(-1500, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
ym1500 := time.Date(-1500, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
y11500 := time.Date(11500, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
var s string
|
||||
err = db.QueryRow("SELECT $1::timestamp::text", y_1500).Scan(&s)
|
||||
err = db.QueryRow("SELECT $1::timestamp::text", ym1500).Scan(&s)
|
||||
if err != nil {
|
||||
t.Errorf("Encoding -infinity, expected no error, got %q", err)
|
||||
}
|
||||
if s != "-infinity" {
|
||||
t.Errorf("Encoding -infinity, expected %q, got %q", "-infinity", s)
|
||||
}
|
||||
err = db.QueryRow("SELECT $1::timestamptz::text", y_1500).Scan(&s)
|
||||
err = db.QueryRow("SELECT $1::timestamptz::text", ym1500).Scan(&s)
|
||||
if err != nil {
|
||||
t.Errorf("Encoding -infinity, expected no error, got %q", err)
|
||||
}
|
||||
|
||||
2
vendor/github.com/lib/pq/uuid_test.go
generated
vendored
2
vendor/github.com/lib/pq/uuid_test.go
generated
vendored
@@ -33,7 +33,7 @@ func TestDecodeUUIDBackend(t *testing.T) {
|
||||
db := openTestConn(t)
|
||||
defer db.Close()
|
||||
|
||||
var s string = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a"
|
||||
var s = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a"
|
||||
var scanned interface{}
|
||||
|
||||
err := db.QueryRow(`SELECT $1::uuid`, s).Scan(&scanned)
|
||||
|
||||
Reference in New Issue
Block a user