Skip to content
This repository
Browse code

Fix SQL queries to work with PostgreSQL (untested on other backends).

  • Loading branch information...
commit 7fbe4733ecddbb13754ad76c94c490bec7e607ed 1 parent 0f02798
Michael Stapelberg stapelberg authored

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. +4 3 tracstats/web_ui.py
7 tracstats/web_ui.py
... ... @@ -1,4 +1,3 @@
1   -
2 1 # stdlib imports
3 2 import datetime
4 3 import locale
@@ -1024,9 +1023,10 @@ def _process_tickets(self, req, cursor, where, since, data):
1024 1023 from ticket
1025 1024 where (resolution is null or length(resolution) = 0) """ +
1026 1025 where.replace('where', 'and').replace('author', 'reporter') + """
  1026 + group by component
1027 1027 ) as open using (component) """ +
1028 1028 where.replace('time', 't.time').replace('author', 't.reporter') + """
1029   - group by 1 order by 2 desc
  1029 + group by t.component, open.total order by count desc
1030 1030 """)
1031 1031 rows = cursor.fetchall()
1032 1032 stats = []
@@ -1045,9 +1045,10 @@ def _process_tickets(self, req, cursor, where, since, data):
1045 1045 from ticket
1046 1046 where (resolution is null or length(resolution) = 0) """ +
1047 1047 where.replace('where', 'and').replace('author', 'reporter') + """
  1048 + group by milestone
1048 1049 ) as open using (milestone) """ +
1049 1050 where.replace('time', 't.time').replace('author', 't.reporter') + """
1050   - group by 1 order by 2 desc
  1051 + group by t.milestone, open.total order by count desc
1051 1052 """)
1052 1053 rows = cursor.fetchall()
1053 1054 stats = []

0 comments on commit 7fbe473

Please sign in to comment.
Something went wrong with that request. Please try again.