From: Michael Vrable Date: Wed, 23 May 2007 18:12:12 +0000 (-0700) Subject: Use NULL in the local database to indicate that blocks are not expired. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=fb51ed45b5b584dc7223ecce4f2703f48a2dea17;p=cumulus.git Use NULL in the local database to indicate that blocks are not expired. --- diff --git a/localdb.cc b/localdb.cc index cc88401..c58549b 100644 --- a/localdb.cc +++ b/localdb.cc @@ -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;