#42943 [Opn->Asn]: Move *timeout initialization from RINIT to connect time

From: Date: Fri, 12 Oct 2007 11:58:38 +0000
Subject: #42943 [Opn->Asn]: Move *timeout initialization from RINIT to connect time
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118460@lists.php.net to get a copy of this message
ID: 42943 Updated by: jani@php.net -Summary: mssql.timeout can only be set in php.ini Reported By: jdolecek at netbsd dot org -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Windows PHP Version: 5.2.4 -Assigned To: +Assigned To: fmk New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2007-10-12 10:06:12] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42943&edit=1

« previous php.bugs (#118460) next »