IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6157


Ignore:
Timestamp:
Jan 21, 2006, 7:16:02 PM (20 years ago)
Author:
jhoblitt
Message:

fix handling of no search parameters

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/p2searchPendingFrames.c

    r6156 r6157  
    55    PS_ASSERT_PTR_NON_NULL(config, NULL);
    66
    7     // build 'where' structure
    87    psMetadata *where = psMetadataAlloc();
    98
    10     // in order to include these restrictions, we need to define these table columns
    119    if (config->camera_name != NULL) {
    1210        psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
     
    3735    }
    3836    */
     37
     38    // if no search criteria were added then set where to NULL to search for
     39    // everything
     40    // XXX fix handling of where
     41    if (where->list->n < 1) {
     42        psFree(where);
     43        where = NULL;
     44    }
    3945
    4046    psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS);
  • trunk/ippTools/src/p2searchRawFrames.c

    r6151 r6157  
    55    PS_ASSERT_PTR_NON_NULL(config, NULL);
    66
    7     // build 'where' structure
    8     psMetadata *where = NULL;
     7    psMetadata *where = psMetadataAlloc();
    98   
    10 //    psMetadataAddS32  (where, PS_LIST_TAIL, "TYPE",  0, "==", P2_TYPE_OBJECT);
    11 
    129    if (config->camera_name != NULL) {
    1310        psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
     
    2623    */
    2724
     25    // if no search criteria were added then set where to NULL to search for
     26    // everything
     27    // XXX fix handling of where
     28    if (where->list->n < 1) {
     29        psFree(where);
     30        where = NULL;
     31    }
     32
    2833    psArray *exposures = rawScienceExpSelectRowObjects(config->database, where,
    2934        MAX_ROWS);
    30     psFree (where);
     35    psFree(where);
    3136    if (!exposures) {
    3237        psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found");
Note: See TracChangeset for help on using the changeset viewer.