Repository navigation
Refresh statement metadata after SQLite repreparation - #598
Merged
Merged
Conversation
Automatic SQLite repreparation can change result-column names or counts, leaving Statement caches stale. Refresh them whenever sqlite3_step() reports a reprepare and cover schema-change cases.
Record the automatic repreparation cache fix in PR #598.
SRombauts
added a commit
that referenced
this pull request
Oct 23, 2026
Backport `Statement::getColumnTableName()` and `Column::getTableName()` from #594 to the C++11 maintenance branch (fixes #555 for the 3.x line). Both remain guarded by `SQLITE_ENABLE_COLUMN_METADATA`. Add unit tests and extend the Meson consumer test introduced by #600. No #598 reprepare-cache fix, new SQLite API requirement, or reprepare-specific regression test. CI validation is pending.
Query SQLITE_STMTSTATUS_REPREPARE once per step instead of twice. Carry the cached counter through move construction and extend the reprepare regression test to cover a move after recompilation.
Document that schema changes can leave cached metadata stale until SQLite automatically reprepares the statement during execution.
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.
Fix stale column counts and name-to-index mappings when
sqlite3_step()automatically reprepares a statement after schema changes. DetectSQLITE_STMTSTATUS_REPREPARE, refresh both caches without changing the public API, and add regression tests covering renamed/reordered columns, count changes, empty results, and moved statements.