Skip to content

Commit 0b40aee

Browse files
wayyoungboymethane
andauthored
Avoid panic in TestRowsColumnTypes (#1426)
* optimized the execution flow of the TestRowsColumnTypes unit test * Update driver_test.go --------- Co-authored-by: 渠磊 <[email protected]> Co-authored-by: Inada Naoki <[email protected]>
1 parent 191a7c4 commit 0b40aee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: driver_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -2945,7 +2945,10 @@ func TestRowsColumnTypes(t *testing.T) {
29452945
continue
29462946
}
29472947
}
2948-
2948+
// Avoid panic caused by nil scantype.
2949+
if t.Failed() {
2950+
return
2951+
}
29492952
values := make([]interface{}, len(tt))
29502953
for i := range values {
29512954
values[i] = reflect.New(types[i]).Interface()

0 commit comments

Comments
 (0)