|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-01-10 21:47 UTC] adambaratz@php.net
[2021-01-10 21:47 UTC] adambaratz@php.net
-Status: Open
+Status: Feedback
[2021-01-11 14:57 UTC] jeremys at ha dot com
-Status: Feedback
+Status: Open
[2021-01-11 14:57 UTC] jeremys at ha dot com
[2023-09-27 10:21 UTC] tannaowens6 at googlemail dot com
[2024-05-14 10:21 UTC] kur4bowden at outlook dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ When instantiating a new PDO instance with dblib as the driver, passing a non-null value to $options causes PDO_DBLIB to override the configured timeout and default it to 30 seconds for both connects and queries. For example, when using FreeTDS with a defined query timeout of 300 seconds in freetds.conf ("timeout = 300"), passing an empty array or an array with options that have nothing to do with timeouts sets the query timeout to 30 seconds. The gist is, passing $options to PDO::__construct() should only set the driver options specifically defined in $options, not every driver option. https://github.com/php/php-src/blob/caa710037e663fd78f67533b29611183090068b2/ext/pdo_dblib/dblib_driver.c#L481 Test script: --------------- test-1.php: <?php $pdo = new PDO( 'dblib:dbname=northwinds;host=contoso', 'username', 'password' ); try { $pdo->query( "WAITFOR DELAY '00:00:35'" ); var_dump( $pdo->query( "SELECT 'output' AS Output" )->fetch()['Output'] ); } catch( Throwable $e ) { var_dump( stripos( $pdo->errorInfo()[2], 'DBPROCESS is dead or not enabled' ) === 0 ); } ?> test-2.php: <?php $pdo = new PDO( 'dblib:dbname=northwinds;host=contoso', 'username', 'password', [] ); try { $pdo->query( "WAITFOR DELAY '00:00:35'" ); var_dump( $pdo->query( "SELECT 'output' AS Output" )->fetch()['Output'] ); } catch( Throwable $e ) { var_dump( stripos( $pdo->errorInfo()[2], 'DBPROCESS is dead or not enabled' ) === 0 ); } Expected result: ---------------- test-1.php: string(6) "output" test-2.php: string(6) "output" Actual result: -------------- test-1.php: string(6) "output" test-2.php: bool(true)