Changeset 28294
- Timestamp:
- Jun 10, 2010, 12:16:21 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/pstamp.md (modified) (1 diff)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff)
-
ippTools/src/pstamptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r28196 r28294 1755 1755 KEY(minidvodb_id), CONSTRAINT UNIQUE(minidvodb_id), FOREIGN KEY(minidvodb_id) REFERENCES minidvodbRun (minidvodb_id) 1756 1756 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1757 1758 ALTER TABLE pstampRequest ADD COLUMN timestamp TIMESTAMP AFTER outdir; -
trunk/dbconfig/pstamp.md
r28106 r28294 31 31 uri STR 255 32 32 outdir STR 255 33 timestamp UTC 0001-01-01T00:00:00Z 33 34 fault S32 0 34 35 END -
trunk/ippTools/share/pxadmin_create_tables.sql
r28106 r28294 1364 1364 uri VARCHAR(255), 1365 1365 outdir VARCHAR(255), 1366 timestamp TIMESTAMP, 1366 1367 fault SMALLINT, 1367 1368 PRIMARY KEY(req_id), -
trunk/ippTools/src/pstamptool.c
r28146 r28294 271 271 uri, 272 272 NULL, // outdir 273 NULL, // timestamp 273 274 0 // fault 274 275 )) { … … 547 548 PXOPT_LOOKUP_BOOL(clearfault,config->args, "-clearfault", false); 548 549 550 if (!state && !label && !outProduct && !fault && !uri && !outdir && !name && !reqType && !clearfault) { 551 psError(PS_ERR_UNKNOWN, true, "at least one set option is required"); 552 return false; 553 } 554 549 555 psMetadata *where = psMetadataAlloc(); 550 556 PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "=="); … … 559 565 } 560 566 561 psString query = psStringCopy("UPDATE pstampRequest SET ");567 psString query = psStringCopy("UPDATE pstampRequest SET timestamp = UTC_TIMESTAMP()"); 562 568 563 569 psString stateCheck = NULL; 564 char c = ' ';565 570 if (state) { 566 psStringAppend(&query, "%c state = '%s'", c, state); 567 c = ','; 571 psStringAppend(&query, ", state = '%s'", state); 568 572 if (!strcmp(state, "goto_cleaned")) { 569 573 psStringAppend(&stateCheck, " AND state != 'cleaned'"); … … 571 575 } 572 576 if (label) { 573 psStringAppend(&query, "%c label = '%s'", c, label); 574 c = ','; 577 psStringAppend(&query, ", label = '%s'", label); 575 578 } 576 579 if (outProduct) { 577 psStringAppend(&query, "%c outProduct = '%s'", c, outProduct); 578 c = ','; 580 psStringAppend(&query, ", outProduct = '%s'", outProduct); 579 581 } 580 582 if (outdir) { 581 psStringAppend(&query, "%c outdir = '%s'", c, outdir); 582 c = ','; 583 psStringAppend(&query, ", outdir = '%s'", outdir); 583 584 } 584 585 if (clearfault) { … … 587 588 return false; 588 589 } 589 psStringAppend(&query, "%c fault = 0", c); 590 c = ','; 590 psStringAppend(&query, ", fault = 0"); 591 591 } else if (fault) { 592 psStringAppend(&query, "%c fault = %d", c, fault); 593 c = ','; 592 psStringAppend(&query, ", fault = %d", fault); 594 593 } 595 594 if (uri) { 596 psStringAppend(&query, "%c uri = '%s'", c, uri); 597 c = ','; 595 psStringAppend(&query, ", uri = '%s'", uri); 598 596 } 599 597 if (name) { 600 psStringAppend(&query, "%c name = '%s'", c, name); 601 c = ','; 598 psStringAppend(&query, ", name = '%s'", name); 602 599 } 603 600 if (reqType) { 604 psStringAppend(&query, "%c reqType = '%s'", c, reqType); 605 c = ','; 606 } 607 if (c != ',') { 608 psError(PS_ERR_UNKNOWN, true, "at least one set option is required"); 609 return false; 601 psStringAppend(&query, ", reqType = '%s'", reqType); 610 602 } 611 603
Note:
See TracChangeset
for help on using the changeset viewer.
