|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesmssql_timeout_per_query (last revision 2010-04-15 13:58 UTC by ejsmont dot artur at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-21 16:19 UTC] felipe@php.net
[2010-04-21 16:19 UTC] felipe@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: felipe
[2010-04-21 16:19 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
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