-- This script should be loaded after connecting to the database to be
-- upgraded.
+-- An unspecified bacukp scheme name is now stored in the database as an empty
+-- string rather than as NULL.
+update snapshots set scheme = '' where scheme is null;
+
-- The subblock_signatures table was added to store a signature for old blocks
-- for performing subfile incremental backups.
create table subblock_signatures (
sqlite3_extended_result_codes(db, 1);
+ if (snapshot_scheme == NULL)
+ snapshot_scheme = "";
+
/* Insert this snapshot into the database, and determine the integer key
* which will be used to identify it. */
sqlite3_stmt *stmt = Prepare("insert into "
"values (?, ?, julianday('now'), ?)");
sqlite3_bind_text(stmt, 1, snapshot_name, strlen(snapshot_name),
SQLITE_TRANSIENT);
- if (snapshot_scheme == NULL)
- sqlite3_bind_null(stmt, 2);
- else
- sqlite3_bind_text(stmt, 2, snapshot_scheme, strlen(snapshot_scheme),
- SQLITE_TRANSIENT);
+ sqlite3_bind_text(stmt, 2, snapshot_scheme, strlen(snapshot_scheme),
+ SQLITE_TRANSIENT);
sqlite3_bind_double(stmt, 3, intent);
rc = sqlite3_step(stmt);
{
statcache_path = path;
statcache_path += "/statcache2";
- if (snapshot_scheme != NULL)
+ if (snapshot_scheme != NULL && strlen(snapshot_scheme) > 0)
statcache_path = statcache_path + "-" + snapshot_scheme;
statcache_tmp_path = statcache_path + "." + snapshot_name;
* snapshot. */
string database_path = localdb_dir + "/localdb.sqlite";
db = new LocalDb;
- db->Open(database_path.c_str(), desc_buf,
- backup_scheme.size() ? backup_scheme.c_str() : NULL,
+ db->Open(database_path.c_str(), desc_buf, backup_scheme.c_str(),
snapshot_intent);
tss = new TarSegmentStore(remote, db);
/* Initialize the stat cache, for skipping over unchanged files. */
metawriter = new MetadataWriter(tss, localdb_dir.c_str(), desc_buf,
- backup_scheme.size()
- ? backup_scheme.c_str()
- : NULL);
+ backup_scheme.c_str());
scanfile(".", false);
create table snapshots (
snapshotid integer primary key,
name text not null,
- scheme text,
+ scheme text not null,
timestamp real,
intent real
);