php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60696 Large Integers problem
Submitted: 2012-01-10 05:20 UTC Modified: 2013-10-15 11:54 UTC
Votes:6
Avg. Score:4.3 ± 0.9
Reproduced:5 of 6 (83.3%)
Same Version:3 (60.0%)
Same OS:5 (100.0%)
From: danhen at web dot de Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.4.0RC5 OS: Windows
Private report: No CVE-ID: None
 [2012-01-10 05:20 UTC] danhen at web dot de
Description:
------------
If large integer values ​​are defined in the source code, connecting to MSSQL-Server fails.

Setup:
Windows Vista
PHP5.4 RC5
php_pdo_sqlsrv as additional extension

The code which defines the value doesn't need to be executed. It's enough defining such values before connecting to mssql (inside a previous loadad class in my case). When 9999999990 is changed to 999999999 everything is fine.

Test script:
---------------
<?php
$iTest = 1;

if($iTest < 9999999990) {
  //do something;
}

$oTest = new PDO('sqlsrv:Server=server;Database=db', 'user', 'pass');



Expected result:
----------------
Blank page for apache, no output for CLI

Actual result:
--------------
PDOException with message:
SQLSTATE[IMSSP]: Failed to retrieve the server version. Unable to continue.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-03 01:39 UTC] yohgaki@php.net
Could you or anyone try see if this happens with other PDO drivers?

$iTest is overflowed (i.e. larger than 31^2), but this should not matter.
 [2012-04-26 05:04 UTC] danhen at web dot de
Have tried other PDO-Drivers. It only happens on pdo_sqlsrv. So what was changed in 5.4 integer Handling?

The broken Code in 5.4 works fine in 5.3 and earlier Versions.
 [2013-03-29 17:40 UTC] aaron at steamcube dot com
Still broken with 5.4.13, 13 months later.
 [2013-03-30 00:53 UTC] rasmus@php.net
We have very few Windows developers. Submit a patch please.
 [2013-03-30 06:21 UTC] pajoye@php.net
There is nothing we can do about 64bit integer now on Windows in 5.x. It requires 
a lot of changes in the engine and in all extensions (basically using int64_t 
instead of long, along with other API changes).

About the sqlsrv drive, I do not see how it could be remotely related. Are you 
saying that this happen only when an error happens before the connect? I tried 
locally and everything worked fine. Is this the exact code you are using to test?
 [2013-03-30 06:21 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2015-01-22 10:20 UTC] rw01 at gmx dot com
Problem still there

Windows 2008 R2 64bit EN Std Server
IIS 7.5
PHP 5.4.35 NTS
MS SQL 2008 R2 SP3

Solution needed. Can anyone help ?
 [2015-01-22 11:08 UTC] rw01 at gmx dot com
After scanning my code for one hour, I found lines causing the error:

$time1 = microtime(true);
...
$time2 = microtime(true);

number_format($time2 - $time1,3);

It's the number_format call on the microtime delta. 
removing the number_format function fixed it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC