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

The BIGINT option bigNumberStrings=true ignored for results.insertId #2460

Open
AgnisLV opened this issue Jan 26, 2021 · 3 comments
Open

The BIGINT option bigNumberStrings=true ignored for results.insertId #2460

AgnisLV opened this issue Jan 26, 2021 · 3 comments

Comments

@AgnisLV
Copy link

AgnisLV commented Jan 26, 2021

For INSERT query the last insertId is not cast to string when the auto-increment column is bigint. The bigNumberStrings is ignored and the result is returned as number.
typeof results.insertId == number

@dougwilson
Copy link
Member

Hi @AgnisLV in the MySQL protocol, the insertId is always returned as a BIGINT no matter the query. The bigNumberStrings is specifically around the typecasting of columns, not of the other aspects of MySQL protocol packets (like the results packet).

@dougwilson
Copy link
Member

AFAIK there is no loss in the value. Can you provide a reproduction for the precision loss you are seeing so we can take a look?

@AgnisLV
Copy link
Author

AgnisLV commented Feb 25, 2021

Sorry, I was too hasty with my last comment. It seems that if supportBigNumbers is enabled then insertId will be returned as a String when numbers are large enough. All clear now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants