IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ticket #680: pslib-0.9.99-psdb_fixes.patch

File pslib-0.9.99-psdb_fixes.patch, 1.7 KB (added by jhoblitt, 20 years ago)

patch to fix various psdb issues

  • src/db/psDB.c

    ? src/db/.foo.txt.swp
    ? src/db/foo.txt
    RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/src/db/psDB.c,v
    retrieving revision 1.45
    diff -u -r1.45 psDB.c
     
    307307
    308308    // Get number of rows returned in result
    309309    rowCount = mysql_num_rows(result);
     310    // XXX has mysql's semantics changed?  If this is zero then why was a
     311    // result set returned?
     312    if (!rowCount) {
     313        mysql_free_result(result);
     314        return NULL;
     315    }
    310316
    311317    // pre-allocate enough elements to hold the complete result set
    312318    // then reset n to 0 so elements are added from the beginning of
     
    475481    }
    476482
    477483    rowCount = mysql_num_rows(result);
     484    // XXX has mysql's semantics changed?  If this is zero then why was a
     485    // result set returned?
     486    if (rowCount == 0) {
     487        mysql_free_result(result);
     488        return NULL;
     489    }
    478490
    479491    // pre-allocate enough elements to hold the complete result set
    480492    // then reset n to 0 so elements are added from the beginning of
     
    12571269            psStringAppend(&query, "%s=%d", item->name, (int)(item->data.B));
    12581270        } else if (item->type == PS_DATA_STRING) {
    12591271            // + column name + _ + like + _ + ' + value + '
    1260             if (*(char *)item->data.V == '\0') {
     1272            // check for NULL and empty ("") strings
     1273            if (item->data.V == NULL || *(char *)item->data.V == '\0') {
    12611274                psStringAppend(&query, "%s IS NULL", item->name);
    12621275            } else {
    12631276                // XXX ASC NOTE: we should have a better match for