Skip to content

Commit a3bfcbb

Browse files
authored
Merge pull request #1198 from PapaPiya/fix_mssql
[PDR-15311][fix(mssql)]: MSSQL数据库,当遇到数值型字段为空的时候采集会报错
2 parents 898cb43 + 69e981a commit a3bfcbb

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)