php.net |  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: 2019-07-09 12:12 UTC
Votes:1
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:
Status: Open Package: pdo_sqlsrv (PECL)
PHP Version: 7.3Git-2019-07-06 (Git) OS: Windows 10 x64 bit
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-07-06 14:55 UTC] soheyb dot djellali at outlook dot com
Description:
------------
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:
---------------
try{
$con = new PDO('sqlsrv:server=localhost;database=Telecaster','sa','');

$stmt = $con->prepare('{CALL cpanel_temp_gold(?)}');
$stmt->bindParam(1,$gold,PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT,255);
$stmt->execute();

echo number_format($gold);

}catch(PDOEXCEPTION $e){

	echo $e->getMessage();
}



Expected result:
----------------
actualle number

Actual result:
--------------
return 0 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-09 12:12 UTC] cmb@php.net
-Package: PDO related +Package: pdo_sqlsrv
 [2019-07-09 12:12 UTC] cmb@php.net
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] <https://github.com/microsoft/msphpsql/issues>
[2] <https://github.com/microsoft/msphpsql/blob/3ba26932d8c835080de305c35c79035f3efa593f/source/pdo_sqlsrv/pdo_stmt.cpp#L239>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 23:01:26 2019 UTC