Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(671)

Issue 41590043: code review 41590043: database/sql: Check errors in QueryRow.Scan

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by johto
Modified:
11 years, 10 months ago
Reviewers:
bradfitz
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

database/sql: Check errors in QueryRow.Scan The previous coding did not correctly check for errors from the driver's Next() or Close(), which could mask genuine errors from the database, as witnessed in issue #6651. Even after this change errors from Close() will be ignored if the query returned no rows (as Rows.Next will have closed the handle already), but it is a lot easier for the drivers to guard against that. Fixes issue 6651.

Patch Set 1 #

Patch Set 2 : diff -r 3895ad0afefe https://code.google.com/p/go #

Patch Set 3 : diff -r 3895ad0afefe https://code.google.com/p/go #

Patch Set 4 : diff -r 24bc2c8febe3 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -4 lines) Patch
M src/pkg/database/sql/fakedb_test.go View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/database/sql/sql.go View 1 2 chunks +13 lines, -4 lines 0 comments Download
M src/pkg/database/sql/sql_test.go View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 6
johto
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 10 months ago (2013-12-12 23:33:41 UTC) #1
johto
On 12/13/13, 12:33 AM, I wrote: > Message: > Hello golang-dev@googlegroups.com, > > I'd like ...
11 years, 10 months ago (2013-12-14 01:10:07 UTC) #2
bradfitz
Marko, You'll need to submit the CLA before for this to be accepted: http://golang.org/doc/contribute.html#copyright Please ...
11 years, 10 months ago (2013-12-16 20:28:42 UTC) #3
johto
Hi Brad, On 12/16/13, 9:28 PM, Brad Fitzpatrick wrote: > You'll need to submit the ...
11 years, 10 months ago (2013-12-16 20:32:15 UTC) #4
bradfitz
LGTM On Thu, Dec 12, 2013 at 3:33 PM, <marko@joh.to> wrote: > Reviewers: golang-dev1, > ...
11 years, 10 months ago (2013-12-16 20:48:29 UTC) #5
bradfitz
11 years, 10 months ago (2013-12-16 20:48:42 UTC) #6
*** Submitted as https://code.google.com/p/go/source/detail?r=04f0931c9808 *** database/sql: Check errors in QueryRow.Scan The previous coding did not correctly check for errors from the driver's Next() or Close(), which could mask genuine errors from the database, as witnessed in issue #6651. Even after this change errors from Close() will be ignored if the query returned no rows (as Rows.Next will have closed the handle already), but it is a lot easier for the drivers to guard against that. Fixes issue 6651. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/41590043 Committer: Brad Fitzpatrick <bradfitz@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b