1
0
mirror of https://github.com/golang/go synced 2024-11-19 21:04:43 -07:00
go/src
Daniel Theophanes c026845bd2 database/sql: record the context error in Rows if canceled
Previously it was intended that Rows.Scan would return
an error and Rows.Err would return nil. This was problematic
because drivers could not differentiate between a normal
Rows.Close or a context cancel close.

The alternative is to require drivers to return a Scan to return
an error if the driver is closed while there are still rows to be read.
This is currently not how several drivers currently work and may be
difficult to detect when there are additional rows.

At the same time guard the the Rows.lasterr and prevent a close
while a Rows operation is active.

For the drivers that do not have Context methods, do not check for
context cancelation after the operation, but before for any operation
that may modify the database state.

Fixes #18961

Change-Id: I49a25318ecd9f97a35d5b50540ecd850c01cfa5e
Reviewed-on: https://go-review.googlesource.com/36485
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-08 18:30:39 +00:00
..
archive time: record monotonic clock reading in time.Now, for more accurate comparisons 2017-02-03 19:04:52 +00:00
bufio
builtin
bytes bytes: use Index in Count 2017-02-08 17:52:30 +00:00
cmd cmd/gofmt: clear pattern match map at the correct time 2017-02-08 04:48:20 +00:00
compress all: test adjustments for the iOS builder 2017-01-14 03:27:53 +00:00
container
context context: lazily initialize cancelCtx done channel 2017-02-01 20:08:41 +00:00
crypto crypto/tls: document that only tickets are supported. 2017-02-08 17:54:06 +00:00
database/sql database/sql: record the context error in Rows if canceled 2017-02-08 18:30:39 +00:00
debug
encoding encoding/json: add Valid for checking validity of input bytes 2017-02-07 23:48:44 +00:00
errors
expvar
flag
fmt
go cmd/go, go/build: better defenses against GOPATH=GOROOT 2017-02-07 18:45:43 +00:00
hash hash/crc32: use sub-benchmarks 2017-02-08 17:17:08 +00:00
html
image Revert "image: fix the overlap check in Rectangle.Intersect." 2017-02-07 15:21:56 +00:00
index/suffixarray
internal
io io: fix test when MultiReader is inlined with -l=3 2017-02-02 18:56:20 +00:00
log
math math/big: add IsInt64/IsUint64 predicates 2017-02-07 23:02:33 +00:00
mime mime/multipart: allow boundary len <= 70 2017-02-01 21:06:49 +00:00
net net/http/httputil: don't log read error when it's context.Canceled 2017-02-06 19:16:56 +00:00
os os: make Stdin.Stat() return ModeCharDevice if Stdin is console 2017-02-07 23:59:31 +00:00
path path/filepath: ignore dot for Dir(\\server\share) 2017-02-04 07:24:20 +00:00
plugin
reflect reflect: adjust documentation on Value 2017-02-01 19:11:34 +00:00
regexp
runtime runtime: use atomic ops for fwdSig, make sigtable immutable 2017-02-08 04:14:41 +00:00
sort sort: optimize average calculation in binary search 2017-02-06 17:08:13 +00:00
strconv
strings bytes: use Index in Count 2017-02-08 17:52:30 +00:00
sync
syscall syscall: regenerate zsyscall_darwin_arm64.go with mksyscall.pl 2017-02-01 22:09:32 +00:00
testing testing: clarify T.Parallel() godoc wording 2017-02-07 15:30:49 +00:00
text text/template: remove duplicate logic in conditional 2017-02-07 15:10:25 +00:00
time time: bound file reads and validate LoadLocation argument 2017-02-08 16:20:25 +00:00
unicode
unsafe
vendor/golang_org/x vendor/golang.org/x/crypto/curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 20:14:03 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash buildall.bash: clarify target selection 2017-02-04 04:34:36 +00:00
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc