Closed
Description
Hey guys, thanks a lot for the great work on this driver! I just have a quick question about the recent introduction of support for uint64 params in the driver: Is the code meant to work for non-prepared statements?
As a quick test I added the following code to the driver's TestUint64
(using HEAD for the repo):
runTests(t, dsn+"&interpolateParams=true", func(dbt *DBTest) {
row := dbt.db.QueryRow(`SELECT ?, ?, ? ,?, ?, ?, ?, ?`,
u0, uhigh, utop, uall,
s0, shigh, stop, sall,
)
var ua, ub, uc, ud uint64
var sa, sb, sc, sd int64
err := row.Scan(&ua, &ub, &uc, &ud, &sa, &sb, &sc, &sd)
if err != nil {
dbt.Fatal(err)
}
switch {
case ua != u0,
ub != uhigh,
uc != utop,
ud != uall,
sa != s0,
sb != shigh,
sc != stop,
sd != sall:
dbt.Fatal("Unexpected result value")
}
})
And the test output turned into this:
--- FAIL: TestUint64 (0.00 seconds)
driver_test.go:836: sql: converting Exec argument #2's type: uint64 values with high bit set are not supported
This is basically the same code as the existing test case, except the query isn't from the context of a prepared-statement. Is this intentionally unsupported or is it a bug?