Changeset 29664
- Timestamp:
- Nov 4, 2010, 12:05:06 PM (16 years ago)
- Location:
- branches/eam_branches/ipp-20101103/ippTools
- Files:
-
- 3 edited
-
share/difftool_definestackstack_part0.sql (modified) (2 diffs)
-
share/difftool_definestackstack_part1.sql (modified) (3 diffs)
-
src/difftool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/ippTools/share/difftool_definestackstack_part0.sql
r26958 r29664 22 22 stackRun.state = 'full' AND 23 23 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 24 -- template where hook %s24 @STACK2_QUERY@ -- template condition 25 25 GROUP BY 26 26 skycell_id, … … 38 38 JOIN stackSumSkyfile USING(stack_id) 39 39 WHERE 1 40 -- input where hook %s40 @STACK1_QUERY@ -- input condition 41 41 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id AND diffExp.stack2 = template.max_stack_id 42 42 WHERE 43 43 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 44 -- diff where hook %s 45 -- input where hook again %s44 @DIFF0_QUERY@ -- diff constraint 45 @STACK1_QUERY@ -- input constraint 46 46 ORDER BY stackRun.data_group,stackRun.filter -
branches/eam_branches/ipp-20101103/ippTools/share/difftool_definestackstack_part1.sql
r29553 r29664 23 23 stackRun.state = 'full' AND 24 24 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 25 -- template where hook %s25 @STACK2_QUERY@ -- template constraint 26 26 GROUP BY 27 27 skycell_id, … … 39 39 JOIN stackSumSkyfile USING(stack_id) 40 40 WHERE 1 41 -- input where hook %s41 @STACK1_QUERY@ -- input constraint 42 42 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id AND diffExp.stack2 = template.max_stack_id 43 43 WHERE 44 44 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 45 -- diff where hook %s 46 -- input where hook again %s 45 @STACK1_QUERY@ -- input constraint 47 46 group by stackRun.stack_id, 48 47 stackRun.data_group, … … 54 53 template.max_stack_id, 55 54 template.template_label 55 @DIFF1_QUERY@ -- diff constraint 56 56 ORDER BY stackRun.data_group,stackRun.filter,stackRun.skycell_id -
branches/eam_branches/ipp-20101103/ippTools/src/difftool.c
r29553 r29664 2009 2009 if (psListLength(stack1Where->list)) { 2010 2010 psString whereClause = psDBGenerateWhereConditionSQL(stack1Where, NULL); 2011 psStringAppend(&stack1Query, " \nAND %s", whereClause);2011 psStringAppend(&stack1Query, "AND %s", whereClause); 2012 2012 psFree(whereClause); 2013 } else { 2014 stack1Query = psStringCopy("\n"); 2015 } 2013 } 2016 2014 psFree(stack1Where); 2017 2015 2018 2016 if (psListLength(stack2Where->list)) { 2019 2017 psString whereClause = psDBGenerateWhereConditionSQL(stack2Where, NULL); 2020 psStringAppend(&stack2Query, " \nAND %s", whereClause);2018 psStringAppend(&stack2Query, "AND %s", whereClause); 2021 2019 psFree(whereClause); 2022 } else { 2023 stack2Query = psStringCopy("\n"); 2024 } 2020 } 2025 2021 psFree(stack2Where); 2026 2027 2022 2028 2023 // don't queue for stacks that have already been diffed unless requested … … 2030 2025 psString diffQuery1 = NULL; 2031 2026 if (! (reRun || newTemplates) ) { 2032 psStringAppend(&diffQuery0, "\n AND diffExp.diff_id IS NULL"); 2033 psStringAppend(&diffQuery1, "\n AND n_diff = 0"); 2034 } else { 2035 diffQuery0 = psStringCopy("\n"); 2036 diffQuery1 = psStringCopy("\n"); 2037 } 2027 psStringAppend(&diffQuery0, "AND diffExp.diff_id IS NULL"); 2028 psStringAppend(&diffQuery1, "HAVING n_diff = 0"); 2029 } 2038 2030 2039 2031 // find the distinct set of data_groups and filters … … 2050 2042 } 2051 2043 2052 if (!p_psDBRunQueryF(config->dbh, query, stack2Query, stack1Query, diffQuery0, stack1Query)) { 2044 psStringSubstitute(&query, stack1Query, "@STACK1_QUERY@"); 2045 psStringSubstitute(&query, stack2Query, "@STACK2_QUERY@"); 2046 psStringSubstitute(&query, diffQuery0, "@DIFF0_QUERY@"); 2047 2048 if (!p_psDBRunQuery(config->dbh, query)) { 2053 2049 psError(PS_ERR_UNKNOWN, false, "database error"); 2054 2050 psFree(query); … … 2118 2114 psString thisWhere = psDBGenerateWhereConditionSQL(row,NULL); 2119 2115 psStringSubstitute(&thisWhere,"stackRun.","INPUT_"); 2120 psStringAppend(&this_stack1Query," \nAND %s", thisWhere);2116 psStringAppend(&this_stack1Query,"AND %s", thisWhere); 2121 2117 psFree(thisWhere); 2122 2118 2123 psTrace("difftool",1, query,stack2Query,this_stack1Query,diffQuery1,this_stack1Query); 2119 psStringSubstitute(&query, this_stack1Query, "@STACK1_QUERY@"); 2120 psStringSubstitute(&query, stack2Query, "@STACK2_QUERY@"); 2121 psStringSubstitute(&query, diffQuery1, "@DIFF1_QUERY@"); 2122 2123 psTrace("difftool", 1, "%s", query); 2124 2124 if (!psDBTransaction(config->dbh)) { 2125 2125 psError(PS_ERR_UNKNOWN, false, "database error"); … … 2127 2127 } 2128 2128 2129 if (!p_psDBRunQuery F(config->dbh, query, stack2Query, this_stack1Query, diffQuery1, this_stack1Query)) {2129 if (!p_psDBRunQuery(config->dbh, query)) { 2130 2130 psError(PS_ERR_UNKNOWN, false, "database error"); 2131 2131 psFree(query);
Note:
See TracChangeset
for help on using the changeset viewer.
