From 4a312a9c567e5acae9f58587287795e0f7b0cd6c Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Wed, 5 Dec 2007 21:27:37 -0800 Subject: [PATCH] Drop the obsolete snapshot_contents table from the local database. --- localdb.cc | 17 +---------------- schema.sql | 8 -------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/localdb.cc b/localdb.cc index 98b2b09..c0ad7d6 100644 --- a/localdb.cc +++ b/localdb.cc @@ -331,26 +331,11 @@ void LocalDb::UseObject(const ObjectReference& ref) int rc; sqlite3_stmt *stmt; - stmt = Prepare("insert or ignore into snapshot_contents " - "select blockid, ? as snapshotid from block_index " - "where segmentid = ? and object = ?"); - sqlite3_bind_int64(stmt, 1, snapshotid); - sqlite3_bind_int64(stmt, 2, SegmentToId(ref.get_segment())); - string obj = ref.get_sequence(); - sqlite3_bind_text(stmt, 3, obj.c_str(), obj.size(), SQLITE_TRANSIENT); - - rc = sqlite3_step(stmt); - if (rc != SQLITE_DONE) { - fprintf(stderr, "Could not execute INSERT statement!\n"); - ReportError(rc); - } - - sqlite3_finalize(stmt); - stmt = Prepare("insert or ignore into snapshot_refs " "select segmentid, object, size from block_index " "where segmentid = ? and object = ?"); sqlite3_bind_int64(stmt, 1, SegmentToId(ref.get_segment())); + string obj = ref.get_sequence(); sqlite3_bind_text(stmt, 2, obj.c_str(), obj.size(), SQLITE_TRANSIENT); rc = sqlite3_step(stmt); diff --git a/schema.sql b/schema.sql index 1c6e84e..a0556c5 100644 --- a/schema.sql +++ b/schema.sql @@ -39,11 +39,3 @@ create table segments_used ( segmentid integer not null, utilization real ); - --- Index tracking which blocks are used by which snapshots. -create table snapshot_contents ( - blockid integer, - snapshotid integer -); -create unique index snapshot_contents_unique - on snapshot_contents(blockid, snapshotid); -- 2.20.1