Changeset 12885 for trunk/psLib/src/db/psDB.c
- Timestamp:
- Apr 18, 2007, 9:37:31 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r12552 r12885 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.14 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-0 3-22 22:48:34$14 * @version $Revision: 1.142 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-04-18 19:37:31 $ 16 16 * 17 17 * Copyright (C) 2005-2006 Joshua Hoblitt, University of Hawaii … … 1530 1530 } 1531 1531 1532 if ( strcasestr(item->comment, "AUTO_INCREMENT")) {1532 if (psStrcasestr(item->comment, "AUTO_INCREMENT")) { 1533 1533 psStringAppend(&query, " %s", "AUTO_INCREMENT"); 1534 1534 } 1535 if ( strcasestr(item->comment, "Unique")) {1535 if (psStrcasestr(item->comment, "Unique")) { 1536 1536 psStringAppend(&query, " %s", "UNIQUE"); 1537 1537 } 1538 if ( strcasestr(item->comment, "NOT NULL")) {1538 if (psStrcasestr(item->comment, "NOT NULL")) { 1539 1539 psStringAppend(&query, " %s", "NOT NULL"); 1540 1540 } … … 1554 1554 psArray *pKeys = psArrayAllocEmpty(1); 1555 1555 while ((item = psListGetAndIncrement(cursor))) { 1556 if ( strcasestr(item->comment, "Primary Key")) {1556 if (psStrcasestr(item->comment, "Primary Key")) { 1557 1557 psArrayAdd(pKeys, 0, item->name); 1558 1558 } … … 1576 1576 while ((item = psListGetAndIncrement(cursor))) { 1577 1577 // it's just a regular key if it matchs "Key" but not "Primary Key" 1578 if ( strcasestr(item->comment, "Key")1579 && ( strcasestr(item->comment, "Primary Key") == NULL)) {1578 if (psStrcasestr(item->comment, "Key") 1579 && (psStrcasestr(item->comment, "Primary Key") == NULL)) { 1580 1580 psStringAppend(&query, ", KEY(%s)", item->name); 1581 } else if ( strcasestr(item->comment, "AUTO_INCREMENT")) {1581 } else if (psStrcasestr(item->comment, "AUTO_INCREMENT")) { 1582 1582 // this needs to be recognized as a key if it wasn't already 1583 1583 psStringAppend(&query, ", KEY(%s)", item->name); … … 1590 1590 while ((item = psListGetAndIncrement(cursor))) { 1591 1591 // don't compile a regex unless we have too 1592 if ( strcasestr(item->comment, "FKEY") == NULL) {1592 if (psStrcasestr(item->comment, "FKEY") == NULL) { 1593 1593 continue; 1594 1594 } … … 1872 1872 psMetadataItem *mItem = NULL; 1873 1873 while ((mItem = psListGetAndIncrement(mCursor))) { 1874 if (mItem->comment && strcasestr(mItem->comment, "==")) {1874 if (mItem->comment && psStrcasestr(mItem->comment, "==")) { 1875 1875 logicalOp = "OR"; 1876 1876 break; … … 2096 2096 psStringAppend(&query, "%s IS NULL", itemName); 2097 2097 } else { 2098 if (item->comment && strcasestr(item->comment, "LIKE")) {2098 if (item->comment && psStrcasestr(item->comment, "LIKE")) { 2099 2099 // XXX ASC NOTE: we should have a better match for 2100 2100 // char & varchar columns than this. LIKE is OK for
Note:
See TracChangeset
for help on using the changeset viewer.
