VirtualBox

Ignore:
Timestamp:
Nov 26, 2020 2:25:20 PM (4 years ago)
Author:
vboxsync
Message:

testmanager/partial-db-dump.py: Only dump what we need from TestBoxStrTab. bugref:9788

File:
1 edited

Legend:

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

    r86985 r86987  
    118118        'TestResultFailures',
    119119        'Builds',
     120        'TestBoxStrTab',
    120121        'SystemLog',
    121122    ];
     
    183184            idLastTestResult = oDb.fetchOne()[0];
    184185        print('Last test result ID: %s' % (idLastTestResult,));
    185 
    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,));
    192186
    193187        # Tables with idTestSet member.
     
    222216
    223217        # The builds table.
     218        oDb.execute('SELECT MIN(idBuild), MIN(idBuildTestSuite) FROM TestSets WHERE idTestSet >= %s', (idFirstTestSet,));
     219        idFirstBuild = 0;
     220        if oDb.getRowCount() > 0:
     221            idFirstBuild = min(oDb.fetchOne());
     222        print('First build ID: %s' % (idFirstBuild,));
    224223        for sTable in [ 'Builds', ]:
    225224            self._doCopyTo(sTable, oZipFile, oDb,
    226225                           'COPY (SELECT * FROM ' + sTable + ' WHERE idBuild >= %s) TO STDOUT WITH (FORMAT TEXT)',
    227226                           (idFirstBuild,));
     227
     228        # The test box string table.
     229        self._doCopyTo('TestBoxStrTab', oZipFile, oDb, '''
     230COPY (SELECT * FROM TestBoxStrTab WHERE idStr IN (
     231                ( SELECT 0
     232        ) UNION ( SELECT idStrComment     FROM TestBoxes WHERE tsExpire >= %s
     233        ) UNION ( SELECT idStrCpuArch     FROM TestBoxes WHERE tsExpire >= %s
     234        ) UNION ( SELECT idStrCpuName     FROM TestBoxes WHERE tsExpire >= %s
     235        ) UNION ( SELECT idStrCpuVendor   FROM TestBoxes WHERE tsExpire >= %s
     236        ) UNION ( SELECT idStrDescription FROM TestBoxes WHERE tsExpire >= %s
     237        ) UNION ( SELECT idStrOS          FROM TestBoxes WHERE tsExpire >= %s
     238        ) UNION ( SELECT idStrOsVersion   FROM TestBoxes WHERE tsExpire >= %s
     239        ) UNION ( SELECT idStrReport      FROM TestBoxes WHERE tsExpire >= %s
     240        ) ) ) TO STDOUT WITH (FORMAT TEXT)
     241''', (tsEffectiveSafe, tsEffectiveSafe, tsEffectiveSafe, tsEffectiveSafe,
     242      tsEffectiveSafe, tsEffectiveSafe, tsEffectiveSafe, tsEffectiveSafe,));
    228243
    229244        oZipFile.close();
     
    251266            'TestGroupMembers',
    252267            'SchedGroups',
    253             'TestBoxStrTab',
    254268            'TestBoxes',
    255269            'SchedGroupMembers',
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