Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bwknight877 opened this issue Jan 23, 2025 · 0 comments

Comments

@bwknight877
Copy link

bwknight877 commented Jan 23, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant