Index: /trunk/ippdb/configure.ac
===================================================================
--- /trunk/ippdb/configure.ac	(revision 11004)
+++ /trunk/ippdb/configure.ac	(revision 11005)
@@ -7,5 +7,5 @@
 AC_PREREQ(2.59)
 
-AC_INIT([ippdb], [0.0.69], [pan-starrs.ifa.hawaii.edu])
+AC_INIT([ippdb], [0.0.70], [pan-starrs.ifa.hawaii.edu])
 AC_CONFIG_SRCDIR([ippdb.pc.in])
 
Index: /trunk/ippdb/src/ippdb.c
===================================================================
--- /trunk/ippdb/src/ippdb.c	(revision 11004)
+++ /trunk/ippdb/src/ippdb.c	(revision 11005)
@@ -5879,5 +5879,5 @@
 static void p2PendingExpRowFree(p2PendingExpRow *object);
 
-p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
+p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
 {
     p2PendingExpRow *_object;
@@ -5891,4 +5891,5 @@
     _object->p2_version = p2_version;
     _object->label = psStringCopy(label);
+    _object->fault = fault;
 
     return _object;
@@ -5930,4 +5931,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+        psFree(md);
+        return false;
+    }
 
     bool status = psDBCreateTable(dbh, P2PENDINGEXP_TABLE_NAME, md);
@@ -5943,5 +5949,5 @@
 }
 
-bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
+bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
 {
     psMetadata *md = psMetadataAlloc();
@@ -5968,4 +5974,9 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item label");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
         psFree(md);
         return false;
@@ -5994,5 +6005,5 @@
 bool p2PendingExpInsertObject(psDB *dbh, p2PendingExpRow *object)
 {
-    return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label);
+    return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label, object->fault);
 }
 
@@ -6092,4 +6103,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+        psFree(md);
+        return false;
+    }
 
 
@@ -6126,6 +6142,11 @@
         return false;
     }
-
-    return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label);
+    psS16 fault = psMetadataLookupS16(&status, md, "fault");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
+        return false;
+    }
+
+    return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label, fault);
 }
 psArray *p2PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
@@ -6239,5 +6260,5 @@
 static void p2PendingImfileRowFree(p2PendingImfileRow *object);
 
-p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
+p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
 {
     p2PendingImfileRow *_object;
@@ -6252,4 +6273,5 @@
     _object->p1_version = p1_version;
     _object->p2_version = p2_version;
+    _object->fault = fault;
 
     return _object;
@@ -6297,4 +6319,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+        psFree(md);
+        return false;
+    }
 
     bool status = psDBCreateTable(dbh, P2PENDINGIMFILE_TABLE_NAME, md);
@@ -6310,5 +6337,5 @@
 }
 
-bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
+bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
 {
     psMetadata *md = psMetadataAlloc();
@@ -6340,4 +6367,9 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "p2_version", PS_DATA_S32, NULL, p2_version)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item p2_version");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
         psFree(md);
         return false;
@@ -6366,5 +6398,5 @@
 bool p2PendingImfileInsertObject(psDB *dbh, p2PendingImfileRow *object)
 {
-    return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version);
+    return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version, object->fault);
 }
 
@@ -6469,4 +6501,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+        psFree(md);
+        return false;
+    }
 
 
@@ -6508,6 +6545,11 @@
         return false;
     }
-
-    return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version);
+    psS16 fault = psMetadataLookupS16(&status, md, "fault");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
+        return false;
+    }
+
+    return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version, fault);
 }
 psArray *p2PendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Index: /trunk/ippdb/src/ippdb.h
===================================================================
--- /trunk/ippdb/src/ippdb.h	(revision 11004)
+++ /trunk/ippdb/src/ippdb.h	(revision 11005)
@@ -2959,4 +2959,5 @@
     psS32           p2_version;
     char            *label;
+    psS16           fault;
 } p2PendingExpRow;
 
@@ -2971,5 +2972,6 @@
     psS32           p1_version,
     psS32           p2_version,
-    const char      *label
+    const char      *label,
+    psS16           fault
 );
 
@@ -3005,5 +3007,6 @@
     psS32           p1_version,
     psS32           p2_version,
-    const char      *label
+    const char      *label,
+    psS16           fault
 );
 
@@ -3167,4 +3170,5 @@
     psS32           p1_version;
     psS32           p2_version;
+    psS16           fault;
 } p2PendingImfileRow;
 
@@ -3180,5 +3184,6 @@
     const char      *recipe,
     psS32           p1_version,
-    psS32           p2_version
+    psS32           p2_version,
+    psS16           fault
 );
 
@@ -3215,5 +3220,6 @@
     const char      *recipe,
     psS32           p1_version,
-    psS32           p2_version
+    psS32           p2_version,
+    psS16           fault
 );
 
Index: /trunk/ippdb/tests/alloc.c
===================================================================
--- /trunk/ippdb/tests/alloc.c	(revision 11004)
+++ /trunk/ippdb/tests/alloc.c	(revision 11005)
@@ -608,5 +608,5 @@
         p2PendingExpRow *object;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16    );
 
         if (!object) {
@@ -634,4 +634,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -641,5 +644,5 @@
         p2PendingImfileRow *object;
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32    );
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16    );
 
         if (!object) {
@@ -668,4 +671,7 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/insert.c
===================================================================
--- /trunk/ippdb/tests/insert.c	(revision 11004)
+++ /trunk/ippdb/tests/insert.c	(revision 11005)
@@ -208,20 +208,20 @@
         }
 
-        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32)) {
+        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string", -16)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32, -16)) {
             exit(EXIT_FAILURE);
         }
Index: /trunk/ippdb/tests/insertobject.c
===================================================================
--- /trunk/ippdb/tests/insertobject.c	(revision 11004)
+++ /trunk/ippdb/tests/insertobject.c	(revision 11005)
@@ -300,5 +300,5 @@
         }
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -322,5 +322,5 @@
         }
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- /trunk/ippdb/tests/metadatafromobject.c	(revision 11004)
+++ /trunk/ippdb/tests/metadatafromobject.c	(revision 11005)
@@ -714,5 +714,5 @@
         bool            status;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -746,4 +746,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(md);
@@ -755,5 +758,5 @@
         bool            status;
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -788,4 +791,7 @@
         }
         if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
             psFree(md);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- /trunk/ippdb/tests/objectfrommetadata.c	(revision 11004)
+++ /trunk/ippdb/tests/objectfrommetadata.c	(revision 11005)
@@ -1123,4 +1123,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p2PendingExpObjectFromMetadata(md);
@@ -1152,4 +1155,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -1185,4 +1191,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p2PendingImfileObjectFromMetadata(md);
@@ -1215,4 +1224,7 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
