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

int32 #55

Closed
raichu opened this issue Apr 8, 2013 · 6 comments
Closed

int32 #55

raichu opened this issue Apr 8, 2013 · 6 comments

Comments

@raichu
Copy link

raichu commented Apr 8, 2013

Is there any particular reason why int32 data type is not supported?

Also, I don't think executing sqlite3_bind_int for go's int type is the correct action in general. On amd64, C int's are usually 32-bit whereas go ints are 64-bit.

@mattn mattn closed this as completed in d9f6dad Apr 8, 2013
@raichu
Copy link
Author

raichu commented Apr 8, 2013

Thanks a lot for the quick response!
But I think you also need to call sqlite3_bind_int64 on amd64 for ints as well.

@mattn
Copy link
Owner

mattn commented Apr 8, 2013

Sorry I don't understand. What you mean?

@mattn mattn reopened this Apr 8, 2013
@raichu
Copy link
Author

raichu commented Apr 9, 2013

sqlite3_bind_int returns a 32-bit value both on 32-bit and 64-bit machine. The current code is okay for 32-bit machines, but suppose we're working on amd64. Here, when a Go integer is read, sqlite3_bind_int is called. Go integers are 64-bit on amd (well, will be, starting from go 1.1), so I think the correct behavior is to call sqlite3_bind_int64 instead of sqlite3_bind_int on the next line.

Does this make sense?

@mattn
Copy link
Owner

mattn commented Apr 9, 2013

Ah, I understand just now. Thank you.

@mattn
Copy link
Owner

mattn commented Apr 9, 2013

Fixed it.

@mattn mattn closed this as completed Apr 9, 2013
@raichu
Copy link
Author

raichu commented Apr 10, 2013

Thanks a bunch!

This issue was closed.
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

No branches or pull requests

2 participants