Changeset 33119 for trunk/ippTools/src
- Timestamp:
- Jan 19, 2012, 3:39:28 PM (15 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
pstamptool.c (modified) (8 diffs)
-
pstamptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pstamptool.c
r32786 r33119 704 704 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 705 705 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 706 PXOPT_LOOKUP_S64(options, config->args, "-options", false, false);706 PXOPT_LOOKUP_S64(options, config->args, "-options", false, false); 707 707 PXOPT_LOOKUP_S64(dep_id, config->args, "-dep_id", false, false); 708 PXOPT_LOOKUP_S64(parent_id, config->args, "-parent_id", false, false); 709 PXOPT_LOOKUP_BOOL(is_parent, config->args, "-is_parent", false); 708 710 709 711 // unless the job is being inserted with stop state require outputBase … … 716 718 if (!strcmp(job_type, "get_image") || !strcmp(job_type, "detect_query") || !strcmp(job_type, "none")) { 717 719 stampJob = false; 720 } else if (!strcmp(job_type, "child")) { 721 // job_type child's only action is to resolve a dependent 722 // XXX: IS this necessary? 723 if (!dep_id) { 724 psError(PS_ERR_UNKNOWN, true, "dep_id required for child job\n"); 725 return false; 726 } 727 if (is_parent) { 728 psError(PS_ERR_UNKNOWN, true, "job type child can not be a parent job\n"); 729 return false; 730 } 731 stampJob = false; 732 } else if (!strcmp(job_type, "mosaic")) { 733 stampJob = false; 734 is_parent = true; 718 735 } else if (!strcmp(job_type, "stamp")) { 719 736 stampJob = true; … … 723 740 } 724 741 if (!pstampJobInsert(config->dbh, 725 0, // job_id742 0, // job_id 726 743 req_id, 727 744 rownum, … … 733 750 options, 734 751 dep_id, 735 0 // fault_count 752 0, // fault_count 753 parent_id, 754 is_parent 736 755 )) { 737 756 psError(PS_ERR_UNKNOWN, false, "database error"); … … 842 861 843 862 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 863 psString whereStr = NULL; 844 864 if (psListLength(where->list)) { 845 865 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 846 psStringAppend(& query, "AND %s", whereClause);866 psStringAppend(&whereStr, "\n AND %s", whereClause); 847 867 psFree(whereClause); 868 } else { 869 psStringAppend(&whereStr, "%s", ""); 848 870 } 849 871 psFree(where); … … 858 880 } 859 881 860 if (!p_psDBRunQuery(config->dbh, query)) { 861 psError(PS_ERR_UNKNOWN, false, "database error"); 862 psFree(query); 863 return false; 864 } 882 if (!p_psDBRunQueryF(config->dbh, query, whereStr, whereStr)) { 883 psError(PS_ERR_UNKNOWN, false, "database error"); 884 psFree(whereStr); 885 psFree(query); 886 return false; 887 } 888 psFree(whereStr); 865 889 psFree(query); 866 890 … … 956 980 957 981 PXOPT_LOOKUP_S32(fault, config->args, "-set_fault", true, false); 982 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 958 983 959 984 psMetadata *where = psMetadataAlloc(); … … 986 1011 psFree(where); 987 1012 988 if (!p_psDBRunQueryF(config->dbh, query, fault, fault )) {1013 if (!p_psDBRunQueryF(config->dbh, query, fault, fault, state)) { 989 1014 psError(PS_ERR_UNKNOWN, false, "database error"); 990 1015 psFree(query); -
trunk/ippTools/src/pstamptoolConfig.c
r32786 r33119 144 144 psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-options", 0, "define options", 0); 145 145 psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-dep_id", 0, "define job dep_id", 0); 146 psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-parent_id", 0, "define parent's job_id", 0); 147 psMetadataAddBool(addjobArgs, PS_LIST_TAIL, "-is_parent", 0, "define whether job has children", false); 146 148 psMetadataAddS16(addjobArgs, PS_LIST_TAIL, "-fault", 0, "define job result", 0); 147 149 … … 186 188 psMetadataAddS32(stopdependentjobArgs, PS_LIST_TAIL, "-fault_count", 0, "select by fault_count (>=)", 0); 187 189 psMetadataAddS16(stopdependentjobArgs, PS_LIST_TAIL, "-set_fault", 0, "new fault value for job and dependent (required)", 0); 190 psMetadataAddStr(stopdependentjobArgs, PS_LIST_TAIL, "-set_state", 0, "new pstampDependent.state", "new"); 188 191 psMetadataAddStr(stopdependentjobArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by pstampJob label (LIKE comparision)", NULL); 189 192 psMetadataAddU64(stopdependentjobArgs, PS_LIST_TAIL, "-limit", 0, "not used", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
