Skip to content

Conversation

staticlibs
Copy link
Collaborator

This is a backport of the PR #247 to v1.3-ossivalis stable branch.

This change implements Statement#setQueryTimeout() method. It is implemented by scheduling a background task and calling Statement#cancel() when timeout expires.

Timeouted statement has the same behaviour as it would be if cancelled manually - SQLException is thrown and the statement is closed.

Timeout is applied for all execute* calls. For executeBatch() it is applied separately for every single query in a batch.

Testing: new test added.

Fixes: #212

This is a backport of the PR duckdb#247 to `v1.3-ossivalis` stable branch.

This change implements `Statement#setQueryTimeout()` method. It is
implemented by scheduling a background task and calling
`Statement#cancel()` when timeout expires.

Timeouted statement has the same behaviour as it would be if cancelled
manually - `SQLException` is thrown and the statement is closed.

Timeout is applied for all `execute*` calls. For `executeBatch()` it is
applied separately for every single query in a batch.

Testing: new test added.

Fixes: duckdb#212
@staticlibs staticlibs merged commit 84e2624 into duckdb:v1.3-ossivalis Jun 15, 2025
@staticlibs staticlibs deleted the query_timeout_13 branch June 15, 2025 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant