databricks-sql-go icon indicating copy to clipboard operation
databricks-sql-go copied to clipboard

inferType is incorrect for int64 and uint64 in parameters.go, should be SqlBigInt instead of SqlInteger

Open bwknight877 opened this issue 1 year ago • 0 comments

Found in 1.6.1

source: https://github.com/databricks/databricks-sql-go/blob/v1.6.1/parameters.go#L140-L145

when inferring the type of int64 and uint64, it defaults to SqlInteger instead of SqlBigInt

I get the following error:

[INVALID_PARAMETER_MARKER_VALUE.INVALID_VALUE_FOR_DATA_TYPE] An invalid parameter mapping was provided: the value '1727794461976117000' for parameter 'hst_cursor' cannot be cast to INT because it is malformed. SQLSTATE: 22023

example db parameter:

var value int64 = 1727794461976117000
param := dbsql.Parameter{Name: "hst_cursor", Value: value}

I can work around this for now by setting the dbsql.Parameter type, but this looks like a bug in the inferType function

bwknight877 avatar Jan 23 '25 15:01 bwknight877