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

database/sql: why can't you use uint64 with high bits set? #6113

Closed
gopherbot opened this issue Aug 12, 2013 · 3 comments
Closed

database/sql: why can't you use uint64 with high bits set? #6113

gopherbot opened this issue Aug 12, 2013 · 3 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 12, 2013

by vslene:

i use mysql driver github.com/go-sql-driver/mysql
Select uint64 value from mysql no error.
But insert and update the value has return an error.

What steps will reproduce the problem?
http://play.golang.org/p/Qawz_5A4qZ

Which version are you using?  (run 'go version')
go version go1.1 darwin/amd64

source code url
http://code.google.com/p/go/source/browse/src/pkg/database/sql/driver/types.go?name=release#245
@adg
Copy link
Contributor

@adg adg commented Aug 12, 2013

Comment 1:

This is clearly by design, but why? My guess is uint64 is not widely supported by SQL
engines. Brad?

Labels changed: removed go1.2maybe.

Owner changed to @bradfitz.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Aug 12, 2013

Comment 2 by vslene:

i think should put this choice to the user instead of forbid it.
Like this code, i can read the value normally, but cannot update it.
http://play.golang.org/p/p_a4Sp6n6o
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 12, 2013

Comment 3:

This was one of the original design decisions from Russ.  I think it was mostly about
making the drivers simpler, having to work with only one integer type (int64) and not 2
or 10.
This bug has the title "why can't you use uint64 with high bits set?" and I answered the
question, so closing this.
If this is actually a problem for some reason, we can discuss.

Owner changed to ---.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.