Repository navigation
Keep URI parameters when cipher_migrate reopens the main database - #629
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
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.
PRAGMA cipher_migratereopens the main database bysqlite3_db_filename(db, "main")withoutSQLITE_OPEN_URI. That name is the pager's own filename, so when the database was opened through a URI such asfile:test.db?psow=0its parameters follow the terminator and the VFS is told to ignore them. ASQLITE_DEBUGbuild aborts inunixOpenon the assertion that guards this, and a release build migrates but drops the parameters the VFS reads at open time, sopsow=0is lost after migration.Adding
SQLITE_OPEN_URIto both reopens, the normal one and the one in the error handler, is always valid for a name the pager produced. A name without parameters is double-zero terminated, so it behaves exactly as before.The new tests migrate the 3.0 and 4.0 fixtures opened with
psow=0, plus the error-handler path throughfail_migrate_closed, and check the row count and thatpsowstays off. They fail onbetain both debug and release builds.