Changeset 3961 for trunk/psLib/src/db
- Timestamp:
- May 18, 2005, 1:19:46 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r3957 r3961 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-05-18 00:55:36 $14 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-05-18 23:19:46 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 875 875 return NULL; 876 876 } 877 if (strstr(item->comment, "AUTO_INCREMENT")) { 878 psStringAppend(&query, "%s", " AUTO_INCREMENT"); 879 } 877 880 878 881 // add a , after every column declaration except the last one … … 886 889 // find database indexes 887 890 while ((item = psListGetAndIncrement(cursor))) { 888 if ((strncmp(item->comment, "Primary Key", strlen("Primary Key"))) == 0) { 891 // XXX NOTE: check for "Primary Key" first before "Key". Yes we're 892 // playing fast and loose here, but I think it's fine... 893 if (strstr(item->comment, "Primary Key")) { 889 894 psStringAppend(&query, ", PRIMARY KEY(%s)", item->name); 890 } else if ((strncmp(item->comment, "Key", strlen("Key"))) == 0) { 895 } else if (strstr(item->comment, "Key")) { 896 psStringAppend(&query, ", KEY(%s)", item->name); 897 } else if (strstr(item->comment, "AUTO_INCREMENT")) { 898 // this needs to be recognized as a key if it wasn't already 891 899 psStringAppend(&query, ", KEY(%s)", item->name); 892 900 }
Note:
See TracChangeset
for help on using the changeset viewer.
