- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/ippTools/src
- Files:
-
- 2 edited
-
. (modified) (2 props)
-
pstamptool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippTools/src
- Property svn:ignore
-
old new 7 7 Makefile.in 8 8 addtool 9 mergetool 9 10 caltool 10 11 camtool
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/eam_branches/ipp-20111122/ippTools/src/pstamptool.c
r32851 r33638 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"); … … 761 780 PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "=="); 762 781 PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "=="); 782 PXOPT_COPY_STR(config->args, where, "-jobType", "jobType", "=="); 763 783 PXOPT_COPY_S64(config->args, where, "-fault", "fault", "=="); 764 784 … … 842 862 843 863 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 864 psString whereStr = NULL; 844 865 if (psListLength(where->list)) { 845 866 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 846 psStringAppend(& query, "AND %s", whereClause);867 psStringAppend(&whereStr, "\n AND %s", whereClause); 847 868 psFree(whereClause); 869 } else { 870 psStringAppend(&whereStr, "%s", ""); 848 871 } 849 872 psFree(where); … … 858 881 } 859 882 860 if (!p_psDBRunQuery(config->dbh, query)) { 861 psError(PS_ERR_UNKNOWN, false, "database error"); 862 psFree(query); 863 return false; 864 } 883 if (!p_psDBRunQueryF(config->dbh, query, whereStr, whereStr)) { 884 psError(PS_ERR_UNKNOWN, false, "database error"); 885 psFree(whereStr); 886 psFree(query); 887 return false; 888 } 889 psFree(whereStr); 865 890 psFree(query); 866 891 … … 956 981 957 982 PXOPT_LOOKUP_S32(fault, config->args, "-set_fault", true, false); 983 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 958 984 959 985 psMetadata *where = psMetadataAlloc(); … … 986 1012 psFree(where); 987 1013 988 if (!p_psDBRunQueryF(config->dbh, query, fault, fault )) {1014 if (!p_psDBRunQueryF(config->dbh, query, fault, fault, state)) { 989 1015 psError(PS_ERR_UNKNOWN, false, "database error"); 990 1016 psFree(query);
Note:
See TracChangeset
for help on using the changeset viewer.
