Repository navigation
fix: A failed rebind leaves the result unbound instead of out of sync - #620
Merged
Merged
Conversation
Closes #614. 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 clean review found nothing above Low. It checked both client libraries.
Generated by Claude Code |
krlmlr
marked this pull request as ready for review
November 29, 2026 12:17
krlmlr
pushed a commit
that referenced
this pull request
Nov 29, 2026
update_metadata() from #618 is now the single path for the metadata after an execution. It replaces setup_output(): its first call caches names, types and the column info and sets up the output binding, also when the metadata appears only after mysql_stmt_execute(). For the first parameter set it also updates the column info of the placeholder columns, so that the chunk takes its types from the latest execution, and later sets keep the types of the first set or raise #618's error. MariaRow.cpp keeps the chunk version of the row code; the .data() fix of #618 for empty buffers is already part of it. bind() keeps #608 and #620 as on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
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 #614. Stacked on #618, which is stacked on #608; all three change
MariaResultPrep::bind().Before this change, a rebind that failed on execution left the result marked as bound from the earlier bind.
dbHasCompleted()returnedFALSE, and every laterdbFetch()failed, with "Commands out of sync" (MariaDB Connector/C) or "Attempt to read a row while there is no result set" (libmysqlclient).Change
bind()now marks the result as unbound before it executes anything, and as bound only once the execution succeeded. After a failed rebind,dbFetch()says "Query needs to be bound before fetching", and a later successfuldbBind()works as before.Tests
tests/testthat/test-dbBind-error.R(new) uses a subquery that returns two rows for one parameter value. It fails at execute time, so the test needs no table, lock or second connection. The test checks the error, the unbound state, and that a later rebind works. Its 6 expectations fail without the fix. Local run against MariaDB 10.11 withNOT_CRAN=true, linked to MariaDB Connector/C: before the merge with #618's branch, the whole suite had 0 failures and the onetest-timezone.Rerror ("US/Alaska" unknown to CCTZ in this container), which also happens onmain. After the merge, the threetest-dbBind-*.Rfiles pass. libmysqlclient and MySQL servers were not tested with this change; CI's MySQL entries currently run MariaDB (#592).Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Generated by Claude Code