ChangeSet ID: 30976 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2007/03/16 19:51:20
Modified files: include : maintainer.php
Log message: Alexander Nicolaysen Sørnes alex@thehandofagony.com Fix maintainer::objectGetEntries(). Remove UNION SELECT and properly check for application queue status for un-queued maintainers
Patch: http://cvs.winehq.org/patch.py?id=30976
Old revision New revision Changes Path 1.30 1.31 +22 -19 appdb/include/maintainer.php
Index: appdb/include/maintainer.php diff -u -p appdb/include/maintainer.php:1.30 appdb/include/maintainer.php:1.31 --- appdb/include/maintainer.php:1.30 17 Mar 2007 0:51:20 -0000 +++ appdb/include/maintainer.php 17 Mar 2007 0:51:20 -0000 @@ -197,29 +197,32 @@ class maintainer { /* Excluding requests for queued apps and versions, as these will be handled automatically */ - if($bQueued) - $sQuery = "SELECT appMaintainers.submitTime, maintainerId FROM - appMaintainers, user_list, appFamily - WHERE appMaintainers.userid = user_list.userid AND - appMaintainers.queued = '?' AND appMaintainers.appId = - appFamily.appId AND appMaintainers.versionId = '' AND - appFamily.queued = 'false' UNION SELECT - appMaintainers.submitTime, maintainerId FROM - appMaintainers, user_list, appVersion WHERE - user_list.userid = appMaintainers.userid AND - appMaintainers.versionId = appVersion.versionId AND - appVersion.queued = 'false' AND appMaintainers.queued = '?' - ORDER by submitTime"; - else - $sQuery = "SELECT maintainerId FROM appMaintainers, user_list - WHERE appMaintainers.userid = user_list.userid ". - "AND queued = '?' ORDER by realname"; + $sQuery = "SELECT DISTINCT maintainerId, appMaintainers.submitTime FROM + appMaintainers, appFamily, appVersion WHERE + appMaintainers.queued = '?' + AND + appFamily.appId = appVersion.appId + AND + ( + ( + appFamily.appId = appMaintainers.appId + AND + appFamily.queued = 'false' + AND + appMaintainers.versionId = '' + ) + OR + ( + appVersion.versionId = appMaintainers.versionId + AND + appVersion.queued = 'false' + ) + )";
if($bQueued) { if($_SESSION['current']->hasPriv("admin")) - return query_parameters($sQuery, $bQueued ? "true" : "false", - $bQueued ? "true" : "false"); + return query_parameters($sQuery, $bQueued ? "true" : "false"); else return NULL; } else