php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42943 Move *timeout initialization from RINIT to connect time
Submitted: 2007-10-12 10:06 UTC Modified: 2007-10-22 22:43 UTC
From: jdolecek at netbsd dot org Assigned:
Status: Closed Package: MSSQL related
PHP Version: 5.2.4 OS: Windows
Private report: No CVE-ID:
 [2007-10-12 10:06 UTC] jdolecek at netbsd dot org
Description:
------------
Value for mssql.timeout is only consulted on PHP engine startup. The value is changeable in script in runtime, but setting it has no effect for newly opened connections. So script gets default timeout set in php.ini, which is 60 seconds in default installation.

This is quite inconvenient in that you need different PHP.INI for web server CGI PHP (where queries are short and you want to cache runaway queries) and batch scripts (which execute long queries and need timeout disabled).

The value used to be applied properly when set in a script in earlier version, perhaps even as recent as 5.1 (but I don't really recall).



Reproduce code:
---------------
echo ini_get('mssql.timeout')."\n";
ini_set('mssql.timeout', 1);
echo ini_get('mssql.timeout')."\n";

$c = mssql_connect(host, user, pass)

$s = mssql_query($c, "WAITFOR DELAY '00:00:05'");

Expected result:
----------------
60
1
Warning: mssql_query(): Query failed in script.php on line 10

Actual result:
--------------
60
1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-12 11:58 UTC] jani@php.net
Frank, There was one report about this but that's now "dead". So let's make this the change request for moving the timeout stuff out of RINIT.

 [2007-10-22 22:43 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Si
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC