Skip to content

Commit 69e981a

Browse files
committed
[PDR-15311][fix(mssql)]: MSSQL数据库,当遇到数值型字段为空的时候采集会报错
1 parent 898cb43 commit 69e981a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

reader/sql/utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ func GetInitScans(length int, rows *sql.Rows, schemas map[string]string, runnerN
152152
nochoiced[i] = true
153153
}
154154
}
155+
nullable, ok := v.Nullable()
156+
nullable = nullable && ok
157+
if nullable {
158+
scanArgs[i] = new(interface{})
159+
}
155160
}
156161
return scanArgs, nochoiced
157162
}

0 commit comments

Comments
 (0)