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:
parent
7250f5342f
commit
54ae448588
9 changed files with 43 additions and 14 deletions
25
vendor/github.com/lib/pq/copy.go
generated
vendored
25
vendor/github.com/lib/pq/copy.go
generated
vendored
|
@ -49,6 +49,7 @@ type copyin struct {
|
|||
buffer []byte
|
||||
rowData chan []byte
|
||||
done chan bool
|
||||
driver.Result
|
||||
|
||||
closed bool
|
||||
|
||||
|
@ -151,6 +152,8 @@ func (ci *copyin) resploop() {
|
|||
switch t {
|
||||
case 'C':
|
||||
// complete
|
||||
res, _ := ci.cn.parseComplete(r.string())
|
||||
ci.setResult(res)
|
||||
case 'N':
|
||||
if n := ci.cn.noticeHandler; n != nil {
|
||||
n(parseError(&r))
|
||||
|
@ -201,6 +204,22 @@ func (ci *copyin) setError(err error) {
|
|||
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 {
|
||||
return -1
|
||||
}
|
||||
|
@ -231,7 +250,11 @@ func (ci *copyin) Exec(v []driver.Value) (r driver.Result, err error) {
|
|||
}
|
||||
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue