From:
Operating system: linux debian lenny
PHP version: 5.2.13
Package: MSSQL related
Bug Type: Bug
Bug description:query timeout in mssql can not be changed per query
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 bug report at http://bugs.php.net/bug.php?id=51562&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51562&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51562&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51562&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51562&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51562&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51562&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51562&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51562&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51562&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51562&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51562&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51562&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51562&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51562&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51562&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51562&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51562&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51562&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51562&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51562&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51562&r=mysqlcfg