Bug #51562 [Opn->Csd]: query timeout in mssql can not be changed per query
| From: | felipe@php.net | Date: | Wed, 21 Apr 2010 14:19:37 +0000 |
| Subject: | Bug #51562 [Opn->Csd]: query timeout in mssql can not be changed per query | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149755@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51562&edit=1
ID: 51562
Updated by: felipe@php.net
Reported by: ejsmont dot artur at gmail dot com
Summary: query timeout in mssql can not be changed per query
-Status: Open
+Status: Closed
Type: Bug
Package: MSSQL related
Operating System: linux debian lenny
PHP Version: 5.2.13
-Assigned To:
+Assigned To: felipe
New Comment:
This bug has been fixed in SVN.
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.
Previous Comments:
------------------------------------------------------------------------
[2010-04-21 16:19:29] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=298255
Log: - Fixed bug #51562 (query timeout in mssql can not be changed per
query)
Patch by: ejsmont dot artur at gmail dot com
------------------------------------------------------------------------
[2010-04-15 15:57:20] ejsmont dot artur at gmail dot com
Description:
------------
im not sure if its a bug or missing functionality but i cant set query
timeout per query. I want to be able to do ini_set('mssql.timeout', 6);
before query to set its timeout to 6 seconds and then
ini_set('mssql.timeout', 20); to set 20s timeout for following query.
This seems to be possible with patch i attach just one line needs to be
added. but im not sure if this would not break anything (seems to work
for me on lenny).
Test script:
---------------
// connect
$connection = mssql_connect($dbhost, $dbuser, $dbpass);
mssql_select_db($dbname, $connection);
// does not have affect if called after connect
ini_set('default_socket_timeout', 1);
ini_set('mssql.connect_timeout', 1);
ini_set('mssql.timeout', 3);
// call sproc with results and no delay
$start = microtime(true);
$rid = mssql_query("exec timeout_test 0, 0, 'Y';");
while ($rec = mssql_fetch_assoc($rid)) {
$row[] = $rec;
}
echo "=".print_r( $row, true )."= in
".(microtime(true)-$start)." with ".mssql_get_last_message()."\n";
Expected result:
----------------
i think it would be good if you could set query timeout at any time and
it would affect the following queries (until you change the timeout
value)
Actual result:
--------------
timeout set after connection is established does not have effect
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51562&edit=1