Skip to content

Touch up the driver code in a couple of places #5

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

Merged
merged 1 commit into from
May 19, 2015
Merged

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.

3 participants