1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

When an RBU vacuum is started on a db identified using a URI filename, pass the same URI parameters when creating the new version of the db. This ensures that RBU vacuum works with password protected databases.

FossilOrigin-Name: ca021ba88106500f347ed65199a4832bc9eb5ef8
This commit is contained in:
dan
2016-04-19 17:11:05 +00:00
parent bff4b6367c
commit 46f0035b48
3 changed files with 22 additions and 8 deletions

View File

@ -2380,7 +2380,21 @@ static void rbuOpenDatabase(sqlite3rbu *p){
p->rc = SQLITE_ERROR;
p->zErrmsg = sqlite3_mprintf("cannot vacuum wal mode database");
}else{
char *zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1", p->zRbu);
char *zTarget;
char *zExtra = 0;
if( strlen(p->zRbu)>=5 && 0==memcmp("file:", p->zRbu, 5) ){
zExtra = &p->zRbu[5];
while( *zExtra ){
if( *zExtra++=='?' ) break;
}
if( *zExtra=='\0' ) zExtra = 0;
}
zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s",
sqlite3_db_filename(p->dbRbu, "main"),
(zExtra==0 ? "" : "&"), (zExtra==0 ? "" : zExtra)
);
if( zTarget==0 ){
p->rc = SQLITE_NOMEM;
return;