Repository navigation
fix: Report the server's message when a fetch fails with MariaDB Connector/C - #612
Merged
Merged
Conversation
…ector/C Closes #603. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
…e connection has an error Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
1 of 2 tasks
Member
Author
Accepted limitationsThe first clean review found a Medium: the fallback could call
Generated by Claude Code |
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.
Closes #603.
With MariaDB Connector/C as the client library, an error in the middle of a fetch reported only
" [0]", becausemysql_stmt_error()andmysql_stmt_errno()are empty there.MariaResultPrep::throw_error()now falls back to the connection'smysql_error()andmysql_errno()when the statement has no error number. With libmysqlclient, nothing changes.The other throw sites were checked:
DbConnectionalready usesmysql_error(), andMariaResultSimpleandMariaBindingthrow fixed messages.src/MariaRow.cpp(lines 86 and 230) still usesmysql_stmt_error()alone, for errors while binding result buffers and fetching columns. It is left alone because #587 rewrites that file.Tests
tests/testthat/test-fetch-error.R(new) uses the issue's query and expects "Subquery returns more than 1 row [1242]" fromdbGetQuery()and fromdbSendQuery()plusdbFetch(). It fails with an unfixed build against MariaDB Connector/C 3.3.17, and passes with this change against both Connector/C 3.3.17 and libmysqlclient 8.0.46. Local runs of the whole suite against MariaDB 10.11 withNOT_CRAN=true, one for each client library, had 0 failures and the onetest-timezone.Rerror ("US/Alaska" unknown to CCTZ in this container), which also happens onmain. MySQL servers were not tested: there is no server in this container, and CI's MySQL entries currently run MariaDB (#592).Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Generated by Claude Code