|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #81143 BIGINT support
Submitted: 2021-06-15 18:42 UTC Modified: -
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:0 (0.0%)
From: simbiat at outlook dot com Assigned:
Status: Open Package: PDO Core
PHP Version: 8.0.7 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
46 + 12 = ?
Subscribe to this entry?

 [2021-06-15 18:42 UTC] simbiat at outlook dot com
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 (, which can even lead to loss of data in some circumstances, because (as confirmed in 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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Oct 05 18:05:54 2022 UTC