Diff
Not logged in

Differences From:

File src/content.c part of check-in [8857e1eabb] - Fixed typos, and extended the documentation of content_deltify. by aku on 2007-08-28 05:00:20. [view]

To:

File src/content.c part of check-in [48c4e69d2b] - Cluster-based synchronization appears to be working. by drh on 2007-09-09 17:51:16. Also file src/content.c part of check-in [bbcb6326c9] - Pulled in the navbar and timeline changes. by aku on 2007-09-17 00:58:51. [view]

@@ -155,8 +155,10 @@
   int rid;
   Stmt s1;
   Blob cmpr;
   Blob hash;
+  int markAsUnclustered = 0;
+
   assert( g.repositoryOpen );
   if( pBlob && srcId==0 ){
     sha1sum_blob(pBlob, &hash);
   }else{
@@ -184,8 +186,9 @@
       return rid;
     }
   }else{
     rid = 0;  /* No entry with the same UUID currently exists */
+    markAsUnclustered = 1;
   }
   db_finalize(&s1);
 
   /* Construct a received-from ID if we do not already have one */
@@ -234,8 +237,15 @@
   ** really a delta.  Record this fact in the delta table.
   */
   if( srcId ){
     db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId);
+  }
+
+  /* Add the element to the unclustered table if has never been
+  ** previously seen.
+  */
+  if( markAsUnclustered ){
+    db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid);
   }
 
   /* Finish the transaction and cleanup */
   db_finalize(&s1);