Skip to content

End a result whose fetch fails to convert - #712

Merged
evertlammerts merged 1 commit into
v2.0-cyanopterafrom
fix-result-conversion
Oct 23, 2026
Merged

evertlammerts merged 1 commit into
v2.0-cyanopterafrom
fix-result-conversion

Conversation

@evertlammerts

Copy link
Copy Markdown
Member

A conversion error during a fetch, such as invalid UTF-8 in a VARCHAR or a Python error from a datetime
conversion, left the result open, so the next statement failed with ResourceInUseException until abort(); 1.5.6
ran it. fetchnumpy and df() on invalid UTF-8 raised SystemError "returned a result with an exception set" where
fetchall raised InvalidInputException.

With this PR, a fetch that fails to convert ends its result with the error (Result::CloseWithError, shared with the
engine failure path and taking the connection's claim when it is free), so the connection is free, an open
transaction stays valid, and a later fetch from that result raises the same error; a Python exception is raised
once as itself and afterwards as InvalidInputException carrying its text. StringConvert checks the string it
builds and raises the engine's invalid unicode error for a UnicodeDecodeError, any other Python error as itself.

@evertlammerts
evertlammerts added this pull request to the merge queue Oct 23, 2026
Merged via the queue into v2.0-cyanoptera with commit 7556c09 Oct 23, 2026
32 checks passed
@evertlammerts
evertlammerts deleted the fix-result-conversion branch October 23, 2026 18: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