Order a version's testData table by Wine version, then date

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-12-20 01:37:48 +01:00
committed by Chris Morgan
parent 66e884d65a
commit 42239a6378
2 changed files with 16 additions and 6 deletions

View File

@@ -621,16 +621,20 @@ class testData{
$bShowAll = ($aClean['bShowAll'] == "true") ? true : false;
$sQuery = "SELECT *
FROM testResults
FROM testResults, ?.versions
WHERE versionId = '?'
AND
versions.value = testResults.testedRelease
AND
versions.product_id = '?'
AND
state = '?'
ORDER BY testedDate DESC";
ORDER BY versions.id DESC,testedDate DESC";
if(!$bShowAll)
$sQuery.=" LIMIT 0,".$iDisplayLimit;
$hResult = query_parameters($sQuery, $this->iVersionId, 'accepted');
$hResult = query_parameters($sQuery, BUGZILLA_DB, $this->iVersionId, BUGZILLA_PRODUCT_ID, 'accepted');
if(!$hResult)
return;
@@ -682,13 +686,17 @@ class testData{
/* retrieve the latest test result for a given version id */
function getNewestTestIdFromVersionId($iVersionId, $sState = 'accepted')
{
$sQuery = "SELECT testingId FROM testResults WHERE
$sQuery = "SELECT testingId FROM testResults, ?.versions WHERE
versions.value = testResults.testedRelease
AND
versions.product_id = '?'
AND
versionId = '?'
AND
state = '?'
ORDER BY testedDate DESC limit 1";
ORDER BY versions.id DESC,testedDate DESC limit 1";
$hResult = query_parameters($sQuery, $iVersionId, $sState);
$hResult = query_parameters($sQuery, BUGZILLA_DB, BUGZILLA_PRODUCT_ID, $iVersionId, $sState);
if(!$hResult)
return 0;

View File

@@ -18,11 +18,13 @@ function test_testData_getNewestTestidFromVersionId()
$oOldTestData = new testData();
$oOldTestData->iVersionId = $iVersionId;
$oOldTestData->sTestedRelease = '0.9.50.';
if(!$oOldTestData->create())
error("oOldTestData->create() failed");
$oNewTestData = new testData();
$oNewTestData->iVersionId = $iVersionId;
$oNewTestData->sTestedRelease = '0.9.51.';
if(!$oNewTestData->create())
error("oNewTestData->create() failed");