IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8461


Ignore:
Timestamp:
Aug 21, 2006, 4:41:22 PM (20 years ago)
Author:
jhoblitt
Message:

don't compare varchar fields with LIKE unless "LIKE" is in the metadataItem's comment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r8340 r8461  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-15 03:23:40 $
     14 *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-22 02:41:22 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    16491649            psStringAppend(&query, "%s IS NULL", item->name);
    16501650        } else {
    1651             // XXX ASC NOTE: we should have a better match for
    1652             // char & varchar columns than this.  LIKE is OK for
    1653             // very large TEXT columns that really shouldn't be
    1654             // used in a where clause...
    1655             psStringAppend(&query, "%s LIKE '%s'", item->name, item->data.V);
     1651            if (item->comment && strstr(item->comment, "LIKE")) {
     1652                // XXX ASC NOTE: we should have a better match for
     1653                // char & varchar columns than this.  LIKE is OK for
     1654                // very large TEXT columns that really shouldn't be
     1655                // used in a where clause...
     1656                psStringAppend(&query, "%s LIKE '%s'", item->name, item->data.V);
     1657            } else {
     1658                psStringAppend(&query, "%s = '%s'", item->name, item->data.V);
     1659            }
    16561660        }
    16571661    } else {
Note: See TracChangeset for help on using the changeset viewer.