Changeset 11027 for trunk/ippdb/src/ippdb.c
- Timestamp:
- Jan 10, 2007, 6:44:06 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.c
r11005 r11027 7764 7764 static void p3PendingExpRowFree(p3PendingExpRow *object); 7765 7765 7766 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label )7766 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault) 7767 7767 { 7768 7768 p3PendingExpRow *_object; … … 7775 7775 _object->p3_version = p3_version; 7776 7776 _object->label = psStringCopy(label); 7777 _object->fault = fault; 7777 7778 7778 7779 return _object; … … 7808 7809 return false; 7809 7810 } 7811 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 7812 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7813 psFree(md); 7814 return false; 7815 } 7810 7816 7811 7817 bool status = psDBCreateTable(dbh, P3PENDINGEXP_TABLE_NAME, md); … … 7821 7827 } 7822 7828 7823 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label )7829 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault) 7824 7830 { 7825 7831 psMetadata *md = psMetadataAlloc(); … … 7841 7847 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) { 7842 7848 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); 7849 psFree(md); 7850 return false; 7851 } 7852 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 7853 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7843 7854 psFree(md); 7844 7855 return false; … … 7867 7878 bool p3PendingExpInsertObject(psDB *dbh, p3PendingExpRow *object) 7868 7879 { 7869 return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label );7880 return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label, object->fault); 7870 7881 } 7871 7882 … … 7960 7971 return false; 7961 7972 } 7973 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 7974 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7975 psFree(md); 7976 return false; 7977 } 7962 7978 7963 7979 … … 7989 8005 return false; 7990 8006 } 7991 7992 return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label); 8007 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 8008 if (!status) { 8009 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 8010 return false; 8011 } 8012 8013 return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label, fault); 7993 8014 } 7994 8015 psArray *p3PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note:
See TracChangeset
for help on using the changeset viewer.
