Changeset 27391 for trunk/ippTools/src/pxtools.c
- Timestamp:
- Mar 22, 2010, 1:58:02 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxtools.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxtools.c
r27258 r27391 110 110 111 111 // shared code for updating the various strings for a Run 112 bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString table, bool has_dist_group)112 bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString runTable, psString idColumn, psString fileTable, bool has_dist_group) 113 113 { 114 114 PS_ASSERT_PTR_NON_NULL(config, false); … … 116 116 PS_ASSERT_PTR_NON_NULL(pQuery, false); 117 117 PS_ASSERT_PTR_NON_NULL(*pQuery, false); 118 PS_ASSERT_PTR_NON_NULL(runTable, false); 119 PS_ASSERT_PTR_NON_NULL(idColumn, false); 120 PS_ASSERT_PTR_NON_NULL(fileTable, false); 118 121 119 122 // make sure that -state is not the only selection parameter … … 158 161 } while (0) 159 162 160 addColumn( table, state);161 addColumn( table, data_group);163 addColumn(runTable, state); 164 addColumn(runTable, data_group); 162 165 if (has_dist_group) { 163 addColumn(table, dist_group); 164 } 165 addColumn(table, note); 166 addColumn(table, label); 166 addColumn(runTable, dist_group); 167 } 168 addColumn(runTable, note); 169 addColumn(runTable, label); 170 171 psString joinHook = psStringCopy(""); 172 psString fileWhere = NULL; 173 if (state && !strcmp(state, "update")) { 174 psStringAppend(&joinHook, "\n JOIN %s USING(%s)", fileTable, idColumn); 175 psStringAppend(pQuery, ", %s.data_state = 'update'", fileTable); 176 psStringAppend(&fileWhere, "AND %s.data_state = 'cleaned'", fileTable); 177 } 167 178 168 179 psString whereClause = psDBGenerateWhereSQL(where, NULL); 169 180 psStringAppend(pQuery, " %s", whereClause); 170 181 psFree(whereClause); 182 if (fileWhere) { 183 psStringAppend(pQuery, fileWhere); 184 } 171 185 172 186 bool mdok; // Status of MD lookup … … 176 190 } 177 191 178 if (!p_psDBRunQuery (config->dbh, *pQuery)) {192 if (!p_psDBRunQueryF(config->dbh, *pQuery, joinHook)) { 179 193 psError(PS_ERR_UNKNOWN, false, "database error"); 180 194 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
