-
Notifications
You must be signed in to change notification settings - Fork 2.5k
bigint error #1371
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
Comments
Hi @k3win, thanks for the report! In order to help get this going, can you please provide all the following information?
Thank you! |
Hi @k3win can you please provide the above information? |
1.node -v create table test(
id int(10) primary key AUTO_INCREMENT,
big bigint
) 5.conf var config = {
db:{
connectionLimit : 10,
host : '172.16.30.149',
user : 'root',
password : 'password',
database : 'kdTestDb',
supportBigNumbers: true
}
} 6.query SELECT * FROM test 7.results [{"id":1,"big":"9223372036854775807"},{"id":2,"big":-9223372036854776000},{"id":3,"big":"1111111111111111111"},{"id":4,"big":-1111111111111111200}] it seems that nodejs do not support the bigint and make it overflow. @dougwilson |
Hi @k3win thanks for the information! Yes, JavaScript does not support them, but we provide some layers to help with that. The main thing I noticed from your report there is you are using a different module. The version 0.4.2 corresponds to a different module: https://www.npmjs.com/package/node-mysql This module is just called "mysql" and the current version is 2.10.2. If you are using that other module, you may want to open a bug on their issue tracker: https://github.com/redblaze/node-mysql/issues |
this time i use "version": "2.10.2", but it's still wrong..@dougwilson |
Thanks for the update, @k3win ! It looks like you missed some of the things I needed to investigate. Please provide items 5 and 6. The two things you marked as 5 and 6 in your reply are not correct. For item 5 I need the SQL I can use to actually insert the data into the table. By default, the table is empty, so I have nothing to select when I try your query. For item 6, I need the complete code, including things like the |
4:
5:
6:
|
mysqljs#1371 Fix bigint out of range problem
@dougwilson Thank for support, I make a mistake that I forget to write |
Fix mysqljs#1371 bigint error
Fix mysqljs#1371 bigint error
today, I found an error at bigint parsing.
query result:
i found that the negative bigint would not been parsed into String and overflowed, and i have set the 'supportBigNumbers' on true
it used to be
-185395119379775634
The text was updated successfully, but these errors were encountered: