Changeset 10951
- Timestamp:
- Jan 5, 2007, 6:38:29 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r10737 r10951 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.12 3$ $Name: not supported by cvs2svn $15 * @date $Date: 200 6-12-14 23:03:40$14 * @version $Revision: 1.124 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-01-06 04:38:29 $ 16 16 * 17 17 * Copyright (C) 2005-2006 Joshua Hoblitt, University of Hawaii 18 18 */ 19 20 #ifdef HAVE_CONFIG_H 21 #include <config.h> 22 #endif 19 23 20 24 #ifdef HAVE_PSDB … … 1507 1511 } 1508 1512 1509 if (str str(item->comment, "AUTO_INCREMENT")) {1513 if (strcasestr(item->comment, "AUTO_INCREMENT")) { 1510 1514 psStringAppend(&query, " %s", "AUTO_INCREMENT"); 1511 1515 } 1512 if (str str(item->comment, "Unique")) {1516 if (strcasestr(item->comment, "Unique")) { 1513 1517 psStringAppend(&query, " %s", "UNIQUE"); 1518 } 1519 if (strcasestr(item->comment, "NOT NULL")) { 1520 psStringAppend(&query, " %s", "NOT NULL"); 1514 1521 } 1515 1522 … … 1528 1535 psArray *pKeys = psArrayAllocEmpty(1); 1529 1536 while ((item = psListGetAndIncrement(cursor))) { 1530 if (str str(item->comment, "Primary Key")) {1537 if (strcasestr(item->comment, "Primary Key")) { 1531 1538 psArrayAdd(pKeys, 0, item->name); 1532 1539 } … … 1550 1557 while ((item = psListGetAndIncrement(cursor))) { 1551 1558 // it's just a regular key if it matchs "Key" but not "Primary Key" 1552 if (str str(item->comment, "Key")1553 && (str str(item->comment, "Primary Key") == NULL)) {1559 if (strcasestr(item->comment, "Key") 1560 && (strcasestr(item->comment, "Primary Key") == NULL)) { 1554 1561 psStringAppend(&query, ", KEY(%s)", item->name); 1555 } else if (str str(item->comment, "AUTO_INCREMENT")) {1562 } else if (strcasestr(item->comment, "AUTO_INCREMENT")) { 1556 1563 // this needs to be recognized as a key if it wasn't already 1557 1564 psStringAppend(&query, ", KEY(%s)", item->name); … … 1775 1782 psMetadataItem *mItem = NULL; 1776 1783 while ((mItem = psListGetAndIncrement(mCursor))) { 1777 if (mItem->comment && str str(mItem->comment, "==")) {1784 if (mItem->comment && strcasestr(mItem->comment, "==")) { 1778 1785 logicalOp = "OR"; 1779 1786 break; … … 1984 1991 psStringAppend(&query, "%s IS NULL", itemName); 1985 1992 } else { 1986 if (item->comment && str str(item->comment, "LIKE")) {1993 if (item->comment && strcasestr(item->comment, "LIKE")) { 1987 1994 // XXX ASC NOTE: we should have a better match for 1988 1995 // char & varchar columns than this. LIKE is OK for
Note:
See TracChangeset
for help on using the changeset viewer.
