Diff
Not logged in

Differences From:

File src/content.c part of check-in [e1c1877c99] - Sync using clusters appears to work. More testing is needed before we go live. by drh on 2007-09-08 16:01:28. [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 */
@@ -236,12 +239,12 @@
   if( srcId ){
     db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId);
   }
 
-  /* Add the element to the unclustered table if it is not a
-  ** a phantom
+  /* Add the element to the unclustered table if has never been
+  ** previously seen.
   */
-  if( pBlob ){
+  if( markAsUnclustered ){
     db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid);
   }
 
   /* Finish the transaction and cleanup */