Changeset 36477 for trunk/ippMonitor
- Timestamp:
- Feb 5, 2014, 2:11:44 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czartool/Gpc1Db.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czartool/Gpc1Db.pm
r33814 r36477 139 139 my $stateCol = $table.".state"; 140 140 141 my $extraState = ""; 142 if ($state eq 'new') { 143 $extraState = " OR $stateCol = 'update' "; 144 } 145 141 146 my $query = $self->{_db}->prepare(<<SQL); 142 147 SELECT COUNT(DISTINCT $id) … … 144 149 JOIN $joinTable USING ($id) 145 150 WHERE label LIKE '$label' 146 AND ( ($faultCol != 0 AND $stateCol = '$state') OR $stateCol = 'failed_revert')151 AND ($faultCol != 0 AND ($stateCol = '$state' $extraState)) 147 152 SQL 148 153 $query->execute; … … 208 213 my $query = undef; 209 214 215 my $joinTable = undef; 216 my $id = undef; 217 if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;} 218 219 # XXX: the "update" page is now obsolete. The standard processing page should now show 220 # counts in new and update state 210 221 if ($state eq "update") { 211 212 222 if ($stage eq "dist") {return 0;} 213 my $joinTable = undef;214 my $id = undef;215 if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}216 223 217 224 if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") { … … 227 234 else { 228 235 236 } 237 238 } 239 # 'new' stuff really includes 'update' stuff, at least for LAP. This is a hack, but there you go 240 elsif ($state eq "new") { 241 242 if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") { 243 # get count of runs in new state and update state that have components left to update 244 $query = $self->{_db}->prepare(<<SQL); 245 SELECT COUNT(DISTINCT $id) 246 FROM $table LEFT JOIN $joinTable 247 USING($id) 248 WHERE label LIKE '$label' 249 AND (state = 'new' OR (state = 'update' AND data_state = 'update')) 250 SQL 251 } else { 229 252 $query = $self->{_db}->prepare(<<SQL); 230 253 SELECT COUNT(state) 231 FROM $table JOIN $joinTable 232 USING($id) 254 FROM $table 233 255 WHERE label LIKE '$label' 234 AND state = ' update';256 AND state = 'new'; 235 257 SQL 236 258 } 237 238 }239 # 'new' stuff really includes 'update' stuff, at least for LAP. This is a hack, but there you go240 elsif ($state eq "new") {241 242 $query = $self->{_db}->prepare(<<SQL);243 SELECT COUNT(state)244 FROM $table245 WHERE label LIKE '$label'246 AND (state = 'new' OR state = 'update')247 SQL248 259 } 249 260 else { … … 256 267 SQL 257 268 } 269 270 # print $query->{Statement} . "\n"; 258 271 259 272 $query->execute;
Note:
See TracChangeset
for help on using the changeset viewer.
