Changeset 31375 for trunk/ippTools/src/pxadd.c
- Timestamp:
- Apr 25, 2011, 2:59:55 PM (15 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src
- Property svn:mergeinfo changed
/branches/haf_branches/haf_add2011/ippTools/src (added) merged: 31280
- Property svn:mergeinfo changed
-
trunk/ippTools/src/pxadd.c
r28181 r31375 37 37 if (!pxIsValidState(state)) { 38 38 psError(PS_ERR_UNKNOWN, false, 39 "invalid camRun state: %s", state);39 "invalid stageRun state: %s", state); 40 40 return false; 41 41 } … … 51 51 52 52 53 bool pxaddRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *sta te)53 bool pxaddRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *stage, const char *state) 54 54 { 55 55 PS_ASSERT_PTR_NON_NULL(config, false); … … 59 59 if (!pxIsValidState(state)) { 60 60 psError(PS_ERR_UNKNOWN, false, 61 "invalid chipRun state: %s", state);61 "invalid stageRun state: %s", state); 62 62 return false; 63 63 } 64 65 psString query = psStringCopy("UPDATE addRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET addRun.state = '%s'"); 66 64 psString query = NULL; 65 if (strcmp(stage, "cam") == 0) { 66 query = psStringCopy("UPDATE addRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET addRun.state = '%s'"); 67 } 68 if (strcmp(stage, "stack") == 0) { 69 ///xxx this needs to be fixed 70 71 /// psString query = psStringCopy("UPDATE addRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET addRun.state = '%s'"); 72 } 67 73 if (where) { 68 74 psString whereClause = psDBGenerateWhereSQL(where, NULL); … … 98 104 } 99 105 100 bool pxaddRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char * label)106 bool pxaddRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *stage, const char *label) 101 107 { 102 108 PS_ASSERT_PTR_NON_NULL(config, false); 103 109 // note label == NULL should be explicitly allowed 104 110 //xxx fix for stack 105 111 psString query = psStringCopy("UPDATE addRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET addRun.label = '%s'"); 106 112 … … 123 129 124 130 bool pxaddQueueByCamID(pxConfig *config, 125 psS64 cam_id, 131 char *stage, 132 psS64 stage_id, 126 133 char *workdir, 127 134 char *reduction, … … 140 147 static psString query = NULL; 141 148 if (!query) { 149 if (strcmp( stage , "cam") == 0) { 142 150 query = pxDataGet("addtool_queue_cam_id.sql"); 143 151 psMemSetPersistent(query, true); 152 } 153 if (strcmp(stage,"stack") == 0) { 154 query = pxDataGet("addtool_queue_stack_id.sql"); 155 psMemSetPersistent(query, true); 156 } 157 if (strcmp(stage,"staticsky") == 0) { 158 query = pxDataGet("addtool_queue_sky_id.sql"); 159 psMemSetPersistent(query, true); 160 } 144 161 if (!query) { 145 162 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 148 165 } 149 166 167 psTrace("addtool.c", PS_LOG_INFO, "pxadd query \n%s\n",query); 150 168 // queue the exp 151 169 // Note: cam_id is being cast here work around psS64 have a different type different 152 170 // on 32/64 153 171 if (!p_psDBRunQueryF(config->dbh, query, 154 "new", // state172 "new", // state 155 173 workdir ? workdir : "NULL", 156 "dirty", //workdir_state174 "dirty", //workdir_state 157 175 reduction? reduction : "NULL", 158 176 label ? label : "NULL", … … 164 182 minidvodb_group, 165 183 minidvodb_name, 166 (long long) cam_id184 (long long) stage_id 167 185 )) { 168 186 psError(PS_ERR_UNKNOWN, false, "database error %s", query);
Note:
See TracChangeset
for help on using the changeset viewer.
