Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sqlcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,7 @@ static int sqlcipher_codec_ctx_migrate(codec_ctx *ctx) {
goto handle_error;
}

rc = sqlite3OsOpen(db->pVfs, db_filename, destfile, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_MAIN_DB, &oflags);
rc = sqlite3OsOpen(db->pVfs, db_filename, destfile, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_URI, &oflags);
if(rc != SQLITE_OK) {
sqlcipher_log(SQLCIPHER_LOG_DEBUG, SQLCIPHER_LOG_CORE, "sqlcipher_codec_ctx_migrate: failed to reopen main database %s: %d", db_filename, rc);
goto handle_error;
Expand Down
13 changes: 13 additions & 0 deletions test/sqlcipher-compatibility.test
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,19 @@ do_test migrate-quote-in-filename {
db close
file delete -force {"a test'ing--db".db} {"a test'ing--db".db-migrated}

# verify that cipher migrate keeps the URI parameters of the main database
do_test migrate-uri-filename {
file copy -force $sampleDir/sqlcipher-3.0-testkey.db test.db
sqlite_orig db file:test.db?psow=0
list [execsql {
PRAGMA key = 'testkey';
PRAGMA cipher_migrate;
SELECT count(*) FROM t1;
}] [file_control_powersafe_overwrite db -1]
} {{ok 0 78536} {0 0}}
db close
file delete -force test.db

# verify escaping of database alias names in sqlcipher_export
do_test export-alias-quoting-1 {
sqlite_orig db test.db
Expand Down