Repository navigation
ext/pdo_odbc: add support for PDO::ATTR_TIMEOUT - #24375
Draft
NattyNarwhal wants to merge 3 commits into
Draft
NattyNarwhal wants to merge 3 commits into
NattyNarwhal wants to merge 3 commits into
Conversation
It's not exhaustive, better to have nop attributes be handled by default
ODBC has both a connection timeout for the connection level and a query timeout at the statement level. Annoyingly, these are somewhat poorly defined. The connection timeout, for instance, can be defined as either a login/connection setup timeout, or as a generic "any action" timeout, and if the latter, the query timeout may not necessarily be implemented. Accordingly, because we have no way to differentiate, we have to set both, and have special handling for the initial connection, as the setAttribute call won't handle early enough if it only handles initial connection timeouts. This means changing it after for a connection isn't relevant for existing statements that have already been constructed; this commit doesn't add a way to change it for a statement after changing it on the connection (be it via setAttribute on the statement, or somehow changing statements from the connection setAttribute). Also annoying is the difference in behaviour between drivers when a timeout happens. For example, SQL Server has a query timeout which just gracefully ends the current query, but Db2i only has a connection timeout which puts the whole connection into an invalid state (but at least it should fail a liveness check for a persistent connection). We don't have much control over this unfortunately. In the future, we should consider clarifying the PDO timeout attribute behaviour's on statements vs. connections, or make them separate attributes, like how PDO_DBLIB has.
NattyNarwhal
force-pushed
the
pdo-odbc-timeout
branch
from
October 16, 2026 19:55
7342921 to
1bec599
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the main commit:
May need some refinement for i.e. statement timeout stuff, but I suspect anything needing a new attribute will need the RFC process.