Skip to content

Throw the execution error when a streamed query fails early - #954

Merged
staticlibs merged 1 commit into
duckdb:v2.0-cyanopterafrom
mateczagany:fix-953-streaming-error
Nov 3, 2026
Merged

staticlibs merged 1 commit into
duckdb:v2.0-cyanopterafrom
mateczagany:fix-953-streaming-error

Conversation

@mateczagany

Copy link
Copy Markdown

With jdbc_stream_results=true, a query that failed before its first chunk was ready reported Invalid result set instead of its own error. complete_query_streaming checked HasError() inside the loop, but EXECUTION_ERROR ends the loop, so the failed stream was returned. The check now runs after the loop, like PendingQueryResult::ExecuteInternal did in 1.x.

Fixes #953

complete_query_streaming checked HasError() only inside the loop, but
EXECUTION_ERROR is observable, so a failed query left the loop and was
returned as a stream. The next JNI call then threw "Invalid result set"
instead of the stored error.

Fixes: duckdb#953

@staticlibs staticlibs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! It looks good to me, I will publish a snapshot with this change shortly.

@staticlibs
staticlibs merged commit 1ecafff into duckdb:v2.0-cyanoptera Nov 3, 2026
17 checks passed
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.

2 participants