Skip to content

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

@bwknight877

Description

@bwknight877

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions