microsoft / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
283 stars 63 forks source link

`sql_variant` invalid `scanType` value #186

Open aangelisc opened 5 months ago

aangelisc commented 5 months ago

Describe the bug This line sets the scanType for sql_variant to nil. This can break downstream libraries when processing rows from a column of this type as it leads to confusion as to what the true type should be (despite the fact that the driver seems to cast these values to string values).

The type should be either an empty interface or string to correlate with the data that is returned from the driver.

See grafana/grafana#81935 for details on the issue that lead to us identifying this.