~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/bugtask.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-05-04 02:01:29 UTC
  • mfrom: (12960.1.1 bug-421901)
  • Revision ID: launchpad@pqm.canonical.com-20110504020129-xa3it1xuib5rwrh3
[r=lifeless][bug=421901] Improve the query used for commented-on-bugs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2007
2007
            )
2008
2008
            """ % sqlvalues(bug_commenter=params.bug_commenter)
2009
2009
            bug_commenter_new_clause = """
2010
 
            EXISTS (SELECT True FROM BugMessage WHERE
2011
 
            Bug.id = BugMessage.bug AND BugMessage.index > 0
2012
 
            AND BugMessage.owner = %(bug_commenter)s)
 
2010
            Bug.id IN (SELECT DISTINCT bug FROM Bugmessage WHERE
 
2011
            BugMessage.index > 0 AND BugMessage.owner = %(bug_commenter)s)
2013
2012
            """ % sqlvalues(bug_commenter=params.bug_commenter)
2014
2013
            if bugmessage_owner:
2015
2014
                bug_commenter_clause = bug_commenter_new_clause