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

BIGINT truncated when use intval() #15632

Closed
chinalu opened this issue Aug 23, 2021 · 6 comments · Fixed by #15703
Closed

BIGINT truncated when use intval() #15632

chinalu opened this issue Aug 23, 2021 · 6 comments · Fixed by #15703
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: medium Medium

Comments

@chinalu
Copy link

chinalu commented Aug 23, 2021

let castValue = intval(value, 10);

@chinalu
Copy link
Author

chinalu commented Aug 25, 2021

BIGINT Should not treated like int

case Column::BIND_PARAM_INT:

@chinalu chinalu changed the title BIGINT overflow when use intval() BIGINT truncated when use intval() Aug 25, 2021
@Jeckerson
Copy link
Member

Could you provide example in numbers?

@Jeckerson Jeckerson added need script to reproduce Script is required to reproduce the issue bug A bug report status: unverified Unverified 5.0 The issues we want to solve in the 5.0 release labels Sep 9, 2021
@chinalu
Copy link
Author

chinalu commented Sep 13, 2021

Could you provide example in numbers?

Thank you for your reply.

Try numbers like 13672236791008669868, 13672252041003479307

@Jeckerson Jeckerson added status: medium Medium and removed need script to reproduce Script is required to reproduce the issue status: unverified Unverified labels Sep 13, 2021
@Izopi4a
Copy link
Member

Izopi4a commented Sep 16, 2021

hmmm... it looks like you are pushing it a bit too far https://www.php.net/manual/en/reserved.constants.php#constant.php-int-max

I mean this is above bigint and close to unsigned bigint, I am not sure PHP is the right tool if you are planning to work with such big numbers

@Jeckerson
Copy link
Member

Jeckerson commented Sep 28, 2021

This only occur when BIGINT column is defined as UNSIGNED. PHP's max int is signed.

signed limit - 9223372036854775807
unsiged limit - 18446744073709551615

@Jeckerson Jeckerson added the breaks bc Functionality that breaks Backwards Compatibility label Sep 28, 2021
@niden niden mentioned this issue Oct 1, 2021
5 tasks
@niden niden linked a pull request Oct 1, 2021 that will close this issue
5 tasks
@niden niden self-assigned this Oct 2, 2021
@niden
Copy link
Member

niden commented Oct 2, 2021

Resolved in #15703

@niden niden closed this as completed Oct 2, 2021
@niden niden added this to Phalcon v5 Aug 25, 2022
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: medium Medium
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants