Index: trunk/ippdb/configure.ac
===================================================================
--- trunk/ippdb/configure.ac	(revision 17144)
+++ trunk/ippdb/configure.ac	(revision 17570)
@@ -7,5 +7,5 @@
 AC_PREREQ(2.61)
 
-AC_INIT([ippdb], [1.1.32], [pan-starrs.ifa.hawaii.edu])
+AC_INIT([ippdb], [1.1.33], [pan-starrs.ifa.hawaii.edu])
 AC_CONFIG_SRCDIR([ippdb.pc.in])
 
Index: trunk/ippdb/src/ippdb.c
===================================================================
--- trunk/ippdb/src/ippdb.c	(revision 17144)
+++ trunk/ippdb/src/ippdb.c	(revision 17570)
@@ -586,5 +586,5 @@
 static void summitExpRowFree(summitExpRow *object);
 
-summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles)
+summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault)
 {
     summitExpRow    *_object;
@@ -600,4 +600,5 @@
     _object->uri = psStringCopy(uri);
     _object->imfiles = imfiles;
+    _object->fault = fault;
 
     return _object;
@@ -652,4 +653,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key NOT NULL", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
+        psFree(md);
+        return false;
+    }
 
     bool status = psDBCreateTable(dbh, SUMMITEXP_TABLE_NAME, md);
@@ -665,5 +671,5 @@
 }
 
-bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles)
+bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault)
 {
     psMetadata *md = psMetadataAlloc();
@@ -700,4 +706,9 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, imfiles)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
+        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;
@@ -726,5 +737,5 @@
 bool summitExpInsertObject(psDB *dbh, summitExpRow *object)
 {
-    return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles);
+    return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles, object->fault);
 }
 
@@ -834,4 +845,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;
+    }
 
 
@@ -878,6 +894,11 @@
         return false;
     }
-
-    return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles);
+    psS16 fault = psMetadataLookupS16(&status, md, "fault");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
+        return false;
+    }
+
+    return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles, fault);
 }
 psArray *summitExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 17144)
+++ trunk/ippdb/src/ippdb.h	(revision 17570)
@@ -339,4 +339,5 @@
     char            *uri;
     psS32           imfiles;
+    psS16           fault;
 } summitExpRow;
 
@@ -353,5 +354,6 @@
     const char      *exp_type,
     const char      *uri,
-    psS32           imfiles
+    psS32           imfiles,
+    psS16           fault
 );
 
@@ -389,5 +391,6 @@
     const char      *exp_type,
     const char      *uri,
-    psS32           imfiles
+    psS32           imfiles,
+    psS16           fault
 );
 
Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 17144)
+++ trunk/ippdb/tests/alloc.c	(revision 17570)
@@ -36,5 +36,5 @@
         summitExpRow    *object;
 
-        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32    );
+        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16    );
 
         if (!object) {
@@ -66,4 +66,8 @@
         }
         if (!object->imfiles == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 17144)
+++ trunk/ippdb/tests/insert.c	(revision 17570)
@@ -28,5 +28,5 @@
         }
 
-        if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32)) {
+        if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16)) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 17144)
+++ trunk/ippdb/tests/insertobject.c	(revision 17570)
@@ -36,5 +36,5 @@
         }
 
-        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32);
+        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 17144)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 17570)
@@ -46,5 +46,5 @@
         bool            status;
 
-        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32);
+        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -82,4 +82,7 @@
         }
         if (!psMetadataLookupS32(&status, md, "imfiles") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
             psFree(md);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- trunk/ippdb/tests/objectfrommetadata.c	(revision 17144)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 17570)
@@ -82,4 +82,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = summitExpObjectFromMetadata(md);
@@ -115,4 +118,7 @@
         }
         if (!object->imfiles == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
