- Timestamp:
- Nov 4, 2010, 12:05:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
