From 13ab724acf7530754242bbdc9043cde38ddc2b94 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 16 Nov 2024 08:43:17 -0600 Subject: [PATCH] Test default behavior for other column types Only int64 is overridden. --- src/database/sql/sql_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go index 7f629dd8326..be26d65b6c7 100644 --- a/src/database/sql/sql_test.go +++ b/src/database/sql/sql_test.go @@ -4282,16 +4282,22 @@ func TestRowsColumnScanner(t *testing.T) { } var ( str string - n int64 + i64 int64 + i int + f64 float64 + ui uint ) - err = db.QueryRowContext(ctx, "SELECT|t|str,n|").Scan(&str, &n) + err = db.QueryRowContext(ctx, "SELECT|t|str,n,n,n,n|").Scan(&str, &i64, &i, &f64, &ui) if err != nil { t.Fatal("select", err) } list := []struct{ got, want any }{ {str, "foo"}, - {n, int64(42)}, + {i64, int64(42)}, + {i, int(1)}, + {f64, float64(1)}, + {ui, uint(1)}, } for index, item := range list {