Repository navigation
fix: dbHasCompleted() and dbGetRowCount() follow dbBind() of a query - #608
Merged
Merged
Conversation
…query Closes #602. 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 clean review found nothing above Low.
Generated by Claude Code |
krlmlr
marked this pull request as ready for review
November 29, 2026 12:08
This was referenced Nov 29, 2026
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 was referenced Nov 29, 2026
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 #602.
Before this change,
MariaResultPrep::bind()marked a query's result as complete.dbHasCompleted()was thereforeTRUEright afterdbBind(), and the usualwhile (!dbHasCompleted(rs)) dbFetch(rs, n)loop returned no rows.dbGetRowCount()also kept adding up across rebinds.Change
bind()now runs the first row of parameters at once instead of settingcomplete_.step()still runs the remaining rows. With no parameter rows, the result is complete.bind()resets the fetched row count, as it already does for the affected row count.dbGetRowCount()therefore counts the rows fetched since the lastdbBind().dbBind(), not in the firstdbFetch().DBItest misses this because
bind_return_valuechecksdbHasCompleted()anddbGetRowCount()only beforedbBind(), and thehas_completed_*androw_count_*specs never bind.The diff in
src/MariaResultPrep.cppis kept minimal because #587 rewrites that file and rebases over this.Tests
tests/testthat/test-dbBind-completed.R(new) has three standalone tests for the fetch loop and for rebinding queries and statements. Without the fix, 9 of its 26 checks fail. Local run against MariaDB 10.11 withNOT_CRAN=true: the whole suite including DBItest had 0 failures and the onetest-timezone.Rerror ("US/Alaska" unknown to CCTZ in this container), which also happens onmain. MySQL was 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