Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: tx.Commit() returns context Err in Go 1.8 instead of sql.ErrTxDone #18147

Closed
c4milo opened this issue Dec 1, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@c4milo
Copy link
Member

@c4milo c4milo commented Dec 1, 2016

What version of Go are you using (go version)?

go version devel +208d4d2 Thu Dec 1 17:42:25 2016 +0000 darwin/amd64

What operating system and processor architecture are you using (go env)?

$ go env
GOARCH="amd64"
GOBIN="/Users/c4milo/work/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/c4milo/work"
GORACE=""
GOROOT="/Users/c4milo/Projects/c4milo/go"
GOTOOLDIR="/Users/c4milo/Projects/c4milo/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sb/d7dxdzv55g3g1p4xtg1mfsm40000gp/T/go-build053957653=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

I had an existing application using pq driver for Postgres. My tests are breaking in Go 1.8 because tx.Commit() returns a context error, instead of sql.ErrTxDone.

What did you expect to see?

sql.ErrTxDone as error if the transaction was rolled back or committed already.

What did you see instead?

"Database error: context canceled"

cc: @kardianos

@kardianos kardianos self-assigned this Dec 1, 2016
@bradfitz bradfitz added this to the Go1.8 milestone Dec 1, 2016
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 1, 2016

CL https://golang.org/cl/33793 mentions this issue.

@gopherbot gopherbot closed this in ae9712c Dec 1, 2016
@golang golang locked and limited conversation to collaborators Dec 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.