|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78259 PDO::PARAM_INT can't handle more then 2147483647
Submitted: 2019-07-06 14:55 UTC Modified: 2020-07-22 18:14 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: soheyb dot djellali at outlook dot com Assigned: cmb (profile)
Status: Not a bug Package: pdo_sqlsrv (PECL)
PHP Version: 7.3Git-2019-07-06 (Git) OS: Windows 10 x64 bit
Private report: No CVE-ID: None
 [2019-07-06 14:55 UTC] soheyb dot djellali at outlook dot com
when ever i output data from sql using pdo bindparam 

if the output is integer and is (bigint) +2147483647 
it always come back 0 

Test script:
$con = new PDO('sqlsrv:server=localhost;database=Telecaster','sa','');

$stmt = $con->prepare('{CALL cpanel_temp_gold(?)}');

echo number_format($gold);

}catch(PDOEXCEPTION $e){

	echo $e->getMessage();

Expected result:
actualle number

Actual result:
return 0 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-09 12:12 UTC]
-Package: PDO related +Package: pdo_sqlsrv
 [2019-07-09 12:12 UTC]
This is likely not a general PDO issue, but rather specific to
PDO_SQLSRV, and therefore it might be best to report it in its
issue tracker[1].  On a quick glance, the int cast[2] looks fishy,
since zend_long is 64bit wide on x64.

[1] <>
[2] <>
 [2020-07-22 18:14 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-07-22 18:14 UTC]
Okay, I had a closer look.

Firstly, you are getting zero (well, actually NULL), because you
did not actually run the query.  Adding $stmt->fetchAll() after
$stmt->execute() would do this.

Then you would get 4294967295, but that is due to a bug in

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 09:03:36 2021 UTC