Changeset 61406 in vbox for trunk/src/VBox
- Timestamp:
- Jun 2, 2016 11:58:14 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/db/partial-db-dump.py
r61265 r61406 170 170 print 'First test set ID: %s' % (idFirstTestSet,); 171 171 172 oDb.execute('SELECT MAX(idTestSet) FROM TestSets WHERE tsCreated >= %s', (tsEffective, )); 173 idLastTestSet = 0; 174 if oDb.getRowCount() > 0: 175 idLastTestSet = oDb.fetchOne()[0]; 176 print 'Last test set ID: %s' % (idLastTestSet,); 177 178 oDb.execute('SELECT MAX(idTestResult) FROM TestResults WHERE tsCreated >= %s', (tsEffective, )); 179 idLastTestResult = 0; 180 if oDb.getRowCount() > 0: 181 idLastTestResult = oDb.fetchOne()[0]; 182 print 'Last test result ID: %s' % (idLastTestResult,); 183 184 172 185 # Tables with idTestSet member. 173 186 for sTable in [ 'TestSets', 'TestResults', 'TestResultValues' ]: 174 187 self._doCopyTo(sTable, oZipFile, oDb, 175 'COPY (SELECT * FROM ' + sTable + ' WHERE idTestSet >= %s) TO STDOUT WITH (FORMAT TEXT)', 176 (idFirstTestSet,)); 188 'COPY (SELECT *\n' 189 ' FROM ' + sTable + '\n' 190 ' WHERE idTestSet >= %s\n' 191 ' AND idTestSet <= %s\n' 192 ' AND idTestResult <= %s\n' 193 ') TO STDOUT WITH (FORMAT TEXT)' 194 , ( idFirstTestSet, idLastTestSet, idLastTestResult,)); 177 195 178 196 # Tables where we have to go via TestResult. … … 181 199 'COPY (SELECT it.*\n' 182 200 ' FROM ' + sTable + ' it, TestResults tr\n' 183 ' WHERE tr.idTestSet >= %s\n' 184 ' AND tr.tsCreated >= %s\n' # performance hack. 185 ' AND it.idTestResult = tr.idTestResult\n' 186 ') TO STDOUT WITH (FORMAT TEXT)', 187 (idFirstTestSet, tsEffective,)); 201 ' WHERE tr.idTestSet >= %s\n' 202 ' AND tr.idTestSet <= %s\n' 203 ' AND tr.idTestResult <= %s\n' 204 ' AND tr.tsCreated >= %s\n' # performance hack. 205 ' AND it.idTestResult = tr.idTestResult\n' 206 ') TO STDOUT WITH (FORMAT TEXT)' 207 , ( idFirstTestSet, idLastTestSet, idLastTestResult, tsEffective,)); 188 208 189 209 # Tables which goes exclusively by tsCreated.
Note:
See TracChangeset
for help on using the changeset viewer.