Changeset 36512 for trunk/ippTools/src/remotetool.c
- Timestamp:
- Feb 13, 2014, 6:00:46 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/remotetool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/remotetool.c
r36511 r36512 184 184 185 185 // Insert the top level run object 186 remoteRunRow *run = remoteRunRowAlloc(0, // rem _id186 remoteRunRow *run = remoteRunRowAlloc(0, // remote_id 187 187 "new", // state 188 188 stage, … … 206 206 return(true); 207 207 } 208 psS64 rem _id = psDBLastInsertID(config->dbh);208 psS64 remote_id = psDBLastInsertID(config->dbh); 209 209 210 210 psArray *list = psArrayAllocEmpty(limit); … … 213 213 psS64 stage_id = psMetadataLookupS64(NULL, md, "stage_id"); 214 214 215 remoteComponentRow *comp = remoteComponentRowAlloc(rem _id,215 remoteComponentRow *comp = remoteComponentRowAlloc(remote_id, 216 216 stage_id); 217 217 if (!comp) { … … 260 260 psMetadata *where = psMetadataAlloc(); 261 261 262 PXOPT_COPY_S64(config->args, where, "-rem _id", "rem_id", "==");262 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 263 263 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 264 264 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "=="); … … 292 292 psMetadata *where = psMetadataAlloc(); 293 293 294 PXOPT_COPY_S64(config->args, where, "-rem _id", "rem_id", "==");294 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 295 295 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 296 296 … … 313 313 { 314 314 PS_ASSERT_PTR_NON_NULL(config, false); 315 315 PXOPT_LOOKUP_S64(remote_id, config->args, "-remote_id", true, false); 316 316 317 psMetadata *where = psMetadataAlloc(); 317 318 psMetadata *values = psMetadataAlloc(); 318 319 319 320 // Wheres 320 PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "=="); 321 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 322 321 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 322 323 323 // Values to set 324 PXOPT_COPY_STR(config->args, values, "-set_label", "label", "=="); 324 325 PXOPT_COPY_STR(config->args, values, "-set_state", "state", "=="); 325 326 PXOPT_COPY_S16(config->args, values, "-fault", "fault", "=="); 326 PXOPT_COPY_S TR(config->args, values, "-set_label", "label", "==");327 PXOPT_COPY_S64(config->args, values, "-job_id", "job_id", "=="); 327 328 328 329 long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values); … … 340 341 { 341 342 PS_ASSERT_PTR_NON_NULL(config, false); 342 343 PXOPT_LOOKUP_S64(remote_id, config->args, "-remote_id", true, false); 344 343 345 psMetadata *where = psMetadataAlloc(); 344 346 // Wheres 345 PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "=="); 346 347 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 348 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 349 psFree(where); 350 347 351 psString query = NULL; 348 352 query = pxDataGet("remotetool_updatepoll.sql"); 349 353 if (!query) { 350 354 psError(PXTOOLS_ERR_SYS,false, "failed to retreive SQL statement"); 351 psFree(where );355 psFree(whereClause); 352 356 return(false); 353 357 } 354 358 355 if (!p_psDBRunQueryF(config->dbh, query,where )) {359 if (!p_psDBRunQueryF(config->dbh, query,whereClause)) { 356 360 psError(PS_ERR_UNKNOWN, false, "database error"); 357 361 psFree(query); 362 psFree(whereClause); 358 363 return false; 359 364 } 360 365 psFree(query); 361 psFree(where );366 psFree(whereClause); 362 367 return(true); 363 368 } … … 374 379 375 380 // required 376 PXOPT_COPY_S64(config->args, where, "-rem _id", "rem_id", "==");381 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 377 382 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 378 383 … … 398 403 399 404 // required 400 PXOPT_COPY_S64(config->args, where, "-rem _id", "rem_id", "==");405 PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "=="); 401 406 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 402 407
Note:
See TracChangeset
for help on using the changeset viewer.
