Use NULL in the local database to indicate that blocks are not expired.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 23 May 2007 18:12:12 +0000 (11:12 -0700)
committerMichael Vrable <mvrable@turin.ucsd.edu>
Wed, 23 May 2007 18:12:12 +0000 (11:12 -0700)
localdb.cc

index cc88401..c58549b 100644 (file)
@@ -163,8 +163,8 @@ void LocalDb::StoreObject(const ObjectReference& ref,
     sqlite3_stmt *stmt;
     static const char s[] =
         "insert into "
-        "block_index(segmentid, object, checksum, size, timestamp, expired) "
-        "values (?, ?, ?, ?, julianday('now'), 0)";
+        "block_index(segmentid, object, checksum, size, timestamp) "
+        "values (?, ?, ?, ?, julianday('now'))";
     const char *tail;
 
     rc = sqlite3_prepare_v2(db, s, strlen(s), &stmt, &tail);
@@ -193,7 +193,7 @@ ObjectReference LocalDb::FindObject(const string &checksum, int64_t size)
     sqlite3_stmt *stmt;
     static const char s[] =
         "select segmentid, object from block_index "
-        "where checksum = ? and size = ? and expired = 0";
+        "where checksum = ? and size = ? and expired is null";
     const char *tail;
 
     ObjectReference ref;