Check-in [1245b42ba3]
Not logged in
Overview

SHA1 Hash:1245b42ba3956b7f488125e5f2904f95f3b91833
Date: 2007-08-01 15:13:52
User: drh
Comment:Fix the test-verify command so that it ignores phantoms.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/verify.c from [7995bb74af] to [2055907abb].

@@ -35,21 +35,23 @@
 ** Panic if anything goes wrong.  If this procedure returns it means
 ** that everything is OK.
 */
 static void verify_rid(int rid){
   Blob uuid, hash, content;
+  if( db_int(0, "SELECT size FROM blob WHERE rid=%d", rid)<0 ){
+    return;  /* No way to verify phantoms */
+  }
   blob_zero(&uuid);
   db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
   if( blob_size(&uuid)!=UUID_SIZE ){
     fossil_panic("not a valid rid: %d", rid);
   }
   content_get(rid, &content);
   sha1sum_blob(&content, &hash);
-/*  blob_reset(&content); */
+  blob_reset(&content);
   if( blob_compare(&uuid, &hash) ){
-printf("content=[%s]\n", blob_str(&content));
-    fossil_panic("hash of rid %d (%b) does not match its uuid (%b)",
+    fossil_fatal("hash of rid %d (%b) does not match its uuid (%b)",
                   rid, &hash, &uuid);
   }
   blob_reset(&uuid);
   blob_reset(&hash);
 }