Modify ↓
#146 closed enhancement (fixed)
PATCH: SQL Bug on summarizers.py (PostgreSQL as the backend)
Reported by: | Pedro Algarvio, aka, s0undt3ch <ufs@…> | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | 0.6 |
Component: | Trac plugin | Version: | dev |
Keywords: | Cc: | ||
Operating System: | Linux |
Description
I seem to have hit an SQL bug while running bitten(trunk) on trac 0.10.3 with PostgreSQL as the backend.
ERROR: column "item_lines.value" must appear in the GROUP BY clause or be used in an aggregate function SQL state: 42803
Here's the patch that at least makes it work again.
-
bitten/trac_ext/summarizers.py
78 78 cursor = db.cursor() 79 79 cursor.execute(""" 80 80 SELECT item_name.value AS unit, item_file.value AS file, 81 item_lines.value AS loc, item_percentage.valueAS cov81 max(item_lines.value) AS loc, max(item_percentage.value) AS cov 82 82 FROM bitten_report AS report 83 83 LEFT OUTER JOIN bitten_report_item AS item_name 84 84 ON (item_name.report=report.id AND item_name.name='name') … … 93 93 item_percentage.item=item_name.item AND 94 94 item_percentage.name='percentage') 95 95 WHERE category='coverage' AND build=%s AND step=%s 96 GROUP BY file, unit ORDER BY unit""", (build.id, step.name))96 GROUP BY file, item_name.value ORDER BY item_name.value""", (build.id, step.name)) 97 97 98 98 data = [] 99 99 total_loc, total_cov = 0, 0
Attachments (0)
Change History (2)
comment:1 Changed 17 years ago by cmlenz
- Status changed from new to assigned
comment:2 Changed 17 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.
Fixed in r445.