Req #81143 [Com]: BIGINT support
Edit report at https://bugs.php.net/bug.php?id=81143&edit=1
ID: 81143
Comment by: architecturehomed at gmail dot com
Reported by: simbiat at outlook dot com
Summary: BIGINT support
Status: Open
Type: Feature/Change Request
Package: PDO Core
PHP Version: 8.0.7
Block user comment: N
Private report: N
New Comment:
Architecture homedesign are sharing latest news about home architecture, home design, home
decoration, roofing, furniture etc. More info to visit:
(https://architecturehomedesign.com)github.com
Previous Comments:
------------------------------------------------------------------------
[2021-06-15 18:42:57] simbiat at outlook dot com
Description:
------------
Currently PHP's PDO does not support BIGINT. When using prepared statements with binding, if we
want to use bind a BIGINT we can't use PDO::PARAM_INT, since it will fail on PHP's side
due to BIGINT being larger than PHP's maximum value for INT. The only alternative option (at
least for MySQL) seems to be "use string" (PDO::PARAM_STR), but this can result in strange
behavior (https://dba.stackexchange.com/questions/293791/missing-an-inserted-row), which can even
lead to loss of data in some circumstances, because (as confirmed in https://bugs.mysql.com/bug.php?id=103992) MySQL
does not guarantee valid and consistent comparison of BIGINT [UNSIGNED] vs VARCHAR.
As such PDO needs to have a way to bind BIGINT values.
Of course, one can use casting in the queries to work around the limitation, but that is
counterintuitive and easily forgettable.
Test script:
---------------
N/A since feature request
Expected result:
----------------
PDO::PARAM_BIGINT is added to future versions of PHP
Actual result:
--------------
Currently no PDO::PARAM_BIGINT
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81143&edit=1
Thread (2 messages)