Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

Last modified 14 years ago

#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

     
    7878        cursor = db.cursor()
    7979        cursor.execute("""
    8080SELECT item_name.value AS unit, item_file.value AS file,
    81        item_lines.value AS loc, item_percentage.value AS cov
     81       max(item_lines.value) AS loc, max(item_percentage.value) AS cov
    8282FROM bitten_report AS report
    8383 LEFT OUTER JOIN bitten_report_item AS item_name
    8484  ON (item_name.report=report.id AND item_name.name='name')
     
    9393      item_percentage.item=item_name.item AND
    9494      item_percentage.name='percentage')
    9595WHERE category='coverage' AND build=%s AND step=%s
    96 GROUP BY file, unit ORDER BY unit""", (build.id, step.name))
     96GROUP BY file, item_name.value ORDER BY item_name.value""", (build.id, step.name))
    9797
    9898        data = []
    9999        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

Fixed in r445.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.