diff options
| author | Ravi Sastry Kadali <ravisastryk@gmail.com> | 2026-01-25 18:29:30 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-02-06 12:10:59 -0800 |
| commit | 9263a71b92e84aa34d0e35887d5c23f5a0a21537 (patch) | |
| tree | 82d3b4c216b4d0b8ebaa8278e8fe916550d4e49e /src/runtime | |
| parent | 0430fa977573866f93e66aa61a66b37ff0738aba (diff) | |
| download | go-9263a71b92e84aa34d0e35887d5c23f5a0a21537.tar.xz | |
database/sql: ensure Null* types have Valid=false when Scan returns error
The Scan methods for NullString, NullInt64, NullInt32, NullFloat64,
NullBool, and NullTime set Valid=true before calling convertAssign.
If convertAssign returns an error, Valid remains true, which creates
an inconsistent state where Valid=true but err!=nil.
Fix by setting Valid only after successful conversion.
Fixes #45662
Change-Id: I855a20abbe517ed017f7c9b8f5603b17bd9d487d
Reviewed-on: https://go-review.googlesource.com/c/go/+/739160
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions
