Switch to absolute latest pq driver (#12859)

This PR updates the lib/pq driver to the current master head to
pick up the deadlock fix in lib/pq#993

Hopefully this will resolve our CI issues.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
zeripath 2020-09-18 15:38:46 +01:00 committed by GitHub
parent 7250f5342f
commit 54ae448588
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 14 deletions

2
go.mod
View file

@ -60,7 +60,7 @@ require (
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4 github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
github.com/klauspost/compress v1.10.11 github.com/klauspost/compress v1.10.11
github.com/lafriks/xormstore v1.3.2 github.com/lafriks/xormstore v1.3.2
github.com/lib/pq v1.7.0 github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
github.com/markbates/goth v1.61.2 github.com/markbates/goth v1.61.2
github.com/mattn/go-isatty v0.0.12 github.com/mattn/go-isatty v0.0.12

2
go.sum
View file

@ -618,6 +618,8 @@ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY=
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc h1:ERSU1OvZ6MdWhHieo2oT7xwR/HCksqKdgK6iYPU5pHI=
github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 h1:uNwtsDp7ci48vBTTxDuwcoTXz4lwtDTe7TjCQ0noaWY= github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 h1:uNwtsDp7ci48vBTTxDuwcoTXz4lwtDTe7TjCQ0noaWY=
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96/go.mod h1:mmIfjCSQlGYXmJ95jFN84AkQFnVABtKuJL8IrzwvUKQ= github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96/go.mod h1:mmIfjCSQlGYXmJ95jFN84AkQFnVABtKuJL8IrzwvUKQ=
github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk= github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk=

View file

@ -3,6 +3,7 @@ language: go
go: go:
- 1.13.x - 1.13.x
- 1.14.x - 1.14.x
- 1.15.x
- master - master
sudo: true sudo: true
@ -13,6 +14,7 @@ env:
- PQGOSSLTESTS=1 - PQGOSSLTESTS=1
- PQSSLCERTTEST_PATH=$PWD/certs - PQSSLCERTTEST_PATH=$PWD/certs
- PGHOST=127.0.0.1 - PGHOST=127.0.0.1
- GODEBUG=x509ignoreCN=0
matrix: matrix:
- PGVERSION=10 - PGVERSION=10
- PGVERSION=9.6 - PGVERSION=9.6

5
vendor/github.com/lib/pq/README.md generated vendored
View file

@ -19,10 +19,7 @@
* Unix socket support * Unix socket support
* Notifications: `LISTEN`/`NOTIFY` * Notifications: `LISTEN`/`NOTIFY`
* pgpass support * pgpass support
* GSS (Kerberos) auth
## Optional Features
* GSS (Kerberos) auth (to use, see GoDoc)
## Tests ## Tests

8
vendor/github.com/lib/pq/conn.go generated vendored
View file

@ -1074,9 +1074,9 @@ func isDriverSetting(key string) bool {
return true return true
case "binary_parameters": case "binary_parameters":
return true return true
case "service": case "krbsrvname":
return true return true
case "spn": case "krbspn":
return true return true
default: default:
return false return false
@ -1168,13 +1168,13 @@ func (cn *conn) auth(r *readBuf, o values) {
var token []byte var token []byte
if spn, ok := o["spn"]; ok { if spn, ok := o["krbspn"]; ok {
// Use the supplied SPN if provided.. // Use the supplied SPN if provided..
token, err = cli.GetInitTokenFromSpn(spn) token, err = cli.GetInitTokenFromSpn(spn)
} else { } else {
// Allow the kerberos service name to be overridden // Allow the kerberos service name to be overridden
service := "postgres" service := "postgres"
if val, ok := o["service"]; ok { if val, ok := o["krbsrvname"]; ok {
service = val service = val
} }

View file

@ -27,7 +27,7 @@ func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) {
return c.open(ctx) return c.open(ctx)
} }
// Driver returnst the underlying driver of this Connector. // Driver returns the underlying driver of this Connector.
func (c *Connector) Driver() driver.Driver { func (c *Connector) Driver() driver.Driver {
return &Driver{} return &Driver{}
} }

25
vendor/github.com/lib/pq/copy.go generated vendored
View file

@ -49,6 +49,7 @@ type copyin struct {
buffer []byte buffer []byte
rowData chan []byte rowData chan []byte
done chan bool done chan bool
driver.Result
closed bool closed bool
@ -151,6 +152,8 @@ func (ci *copyin) resploop() {
switch t { switch t {
case 'C': case 'C':
// complete // complete
res, _ := ci.cn.parseComplete(r.string())
ci.setResult(res)
case 'N': case 'N':
if n := ci.cn.noticeHandler; n != nil { if n := ci.cn.noticeHandler; n != nil {
n(parseError(&r)) n(parseError(&r))
@ -201,6 +204,22 @@ func (ci *copyin) setError(err error) {
ci.Unlock() ci.Unlock()
} }
func (ci *copyin) setResult(result driver.Result) {
ci.Lock()
ci.Result = result
ci.Unlock()
}
func (ci *copyin) getResult() driver.Result {
ci.Lock()
result := ci.Result
ci.Unlock()
if result == nil {
return driver.RowsAffected(0)
}
return result
}
func (ci *copyin) NumInput() int { func (ci *copyin) NumInput() int {
return -1 return -1
} }
@ -231,7 +250,11 @@ func (ci *copyin) Exec(v []driver.Value) (r driver.Result, err error) {
} }
if len(v) == 0 { if len(v) == 0 {
return driver.RowsAffected(0), ci.Close() if err := ci.Close(); err != nil {
return driver.RowsAffected(0), err
}
return ci.getResult(), nil
} }
numValues := len(v) numValues := len(v)

9
vendor/github.com/lib/pq/doc.go generated vendored
View file

@ -57,8 +57,6 @@ supported:
* sslkey - Key file location. The file must contain PEM encoded data. * sslkey - Key file location. The file must contain PEM encoded data.
* sslrootcert - The location of the root certificate file. The file * sslrootcert - The location of the root certificate file. The file
must contain PEM encoded data. must contain PEM encoded data.
* spn - Configures GSS (Kerberos) SPN.
* service - GSS (Kerberos) service name to use when constructing the SPN (default is `postgres`).
Valid values for sslmode are: Valid values for sslmode are:
@ -259,5 +257,12 @@ package:
This package is in a separate module so that users who don't need Kerberos This package is in a separate module so that users who don't need Kerberos
don't have to download unnecessary dependencies. don't have to download unnecessary dependencies.
When imported, additional connection string parameters are supported:
* krbsrvname - GSS (Kerberos) service name when constructing the
SPN (default is `postgres`). This will be combined with the host
to form the full SPN: `krbsrvname/host`.
* krbspn - GSS (Kerberos) SPN. This takes priority over
`krbsrvname` if present.
*/ */
package pq package pq

2
vendor/modules.txt vendored
View file

@ -502,7 +502,7 @@ github.com/kr/text
## explicit ## explicit
github.com/lafriks/xormstore github.com/lafriks/xormstore
github.com/lafriks/xormstore/util github.com/lafriks/xormstore/util
# github.com/lib/pq v1.7.0 # github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
## explicit ## explicit
github.com/lib/pq github.com/lib/pq
github.com/lib/pq/oid github.com/lib/pq/oid