Index: trunk/ippTools/src/p2searchPendingFrames.c
===================================================================
--- trunk/ippTools/src/p2searchPendingFrames.c	(revision 6156)
+++ trunk/ippTools/src/p2searchPendingFrames.c	(revision 6157)
@@ -5,8 +5,6 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    // build 'where' structure
     psMetadata *where = psMetadataAlloc();
 
-    // in order to include these restrictions, we need to define these table columns
     if (config->camera_name != NULL) {
         psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
@@ -37,4 +35,12 @@
     }
     */
+
+    // if no search criteria were added then set where to NULL to search for
+    // everything
+    // XXX fix handling of where
+    if (where->list->n < 1) {
+        psFree(where);
+        where = NULL;
+    }
 
     psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS);
