Skip to content

Conversation

@potocnyj
Copy link

Switches an Sprint for the faster strconv call, and add support for
uint64 vals in the interpolation code

Switches an Sprint for the faster strconv call, and add support for
uint64 vals in the interpolation code
@Preetam
Copy link

Preetam commented May 19, 2015

Do the tests pass? If so, 👍.

@potocnyj
Copy link
Author

Yeah, they pass

potocnyj pushed a commit that referenced this pull request May 19, 2015
Touch up the driver code in a couple of places
@potocnyj potocnyj merged commit 745500e into master May 19, 2015
@potocnyj potocnyj deleted the driver-touch-ups branch May 19, 2015 19:19
@potocnyj
Copy link
Author

Looks like support for uint64 with high-bit set does not work without a prepared statement. I added this code to TestUint64:

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 fails with the following output:

--- 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

Not sure what is going on here yet, I'll update if I figure it out.

@gkristic
Copy link

I think we should open a PR upstream and contribute with the change.

@potocnyj
Copy link
Author

potocnyj commented May 19, 2015 via email

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

Successfully merging this pull request may close these issues.

4 participants