VirtualBox

Changeset 86985 in vbox


Ignore:
Timestamp:
Nov 26, 2020 1:57:42 PM (4 years ago)
Author:
vboxsync
Message:

testmanager/partial-db-dump.py: Do partial dump of the Builds table to reduce backup size. bugref:9788

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/db/partial-db-dump.py

    r83363 r86985  
    102102        'TestBoxesInSchedGroups',       # ?
    103103        'SchedQueues',
    104         'Builds',                       # ??
    105104        'VcsRevisions',                 # ?
    106105        'TestResultStrTab',             # 36K rows, never mind complicated then.
     
    118117        'TestResultValues',             # 2016-05-25: ca. 3728 MB
    119118        'TestResultFailures',
     119        'Builds',
    120120        'SystemLog',
    121121    ];
     
    184184        print('Last test result ID: %s' % (idLastTestResult,));
    185185
     186        # Get the build ID range.
     187        oDb.execute('SELECT MIN(idBuild), MIN(idBuildTestSuite) FROM TestSets WHERE idTestSet >= %s', (idFirstTestSet,));
     188        idFirstBuild = 0;
     189        if oDb.getRowCount() > 0:
     190            idFirstBuild = min(oDb.fetchOne());
     191        print('First build ID: %s' % (idFirstBuild,));
    186192
    187193        # Tables with idTestSet member.
     
    214220                           'COPY (SELECT * FROM ' + sTable + ' WHERE tsCreated >= %s) TO STDOUT WITH (FORMAT TEXT)',
    215221                           (tsEffective,));
     222
     223        # The builds table.
     224        for sTable in [ 'Builds', ]:
     225            self._doCopyTo(sTable, oZipFile, oDb,
     226                           'COPY (SELECT * FROM ' + sTable + ' WHERE idBuild >= %s) TO STDOUT WITH (FORMAT TEXT)',
     227                           (idFirstBuild,));
    216228
    217229        oZipFile.close();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette