Skip to content

Commit 13ab724

Browse files
committed
Test default behavior for other column types
Only int64 is overridden.
1 parent 0a38201 commit 13ab724

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/database/sql/sql_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4282,16 +4282,22 @@ func TestRowsColumnScanner(t *testing.T) {
42824282
}
42834283
var (
42844284
str string
4285-
n int64
4285+
i64 int64
4286+
i int
4287+
f64 float64
4288+
ui uint
42864289
)
4287-
err = db.QueryRowContext(ctx, "SELECT|t|str,n|").Scan(&str, &n)
4290+
err = db.QueryRowContext(ctx, "SELECT|t|str,n,n,n,n|").Scan(&str, &i64, &i, &f64, &ui)
42884291
if err != nil {
42894292
t.Fatal("select", err)
42904293
}
42914294

42924295
list := []struct{ got, want any }{
42934296
{str, "foo"},
4294-
{n, int64(42)},
4297+
{i64, int64(42)},
4298+
{i, int(1)},
4299+
{f64, float64(1)},
4300+
{ui, uint(1)},
42954301
}
42964302

42974303
for index, item := range list {

0 commit comments

Comments
 (0)