Ticket #9976 (assigned defect)

Opened 1 year ago

Last modified 1 year ago

Internal error with Postgresql database.

Reported by: rozhi Assigned to: seccanj (accepted)
Priority: normal Component: FaqPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (Last modified by rjollos)

Clicking on the FAQ top menu option generates an Internal Server Error. The trac.log displays:

ProgrammingError: column "wiki.text" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT name, text, max(version) FROM wiki WHERE name LIKE 'F...

Attachments

Change History

04/18/12 00:49:52 changed by rozhi

The solution is to modify a SQL statement in the macros.py file to be valid with Postgresql. Below is the new SQL statement (macros.py (line 246)): current:

    sql = "SELECT name, text, max(version) FROM wiki WHERE name LIKE '%s%%' GROUP BY name ORDER BY name" % curpage

new:

    sql = "SELECT name, text, version FROM wiki WHERE name LIKE '%s%%' AND version = (select max(version) FROM wiki WHERE name LIKE '%s%%')" % (curpage, curpage)

04/18/12 06:25:01 changed by rjollos

  • description changed.

04/18/12 08:20:05 changed by seccanj

Rozhi, I like when people finds problems, and I like it even more when they also find the solutions ;-)

Thanks for sharing this one.

I will try the modified version with SQLite and eventually update the code in next release asap.

BTW, if you think af anything that may improve this plugin, feel free to open an enhancement request here on trac-hacks (or provide a patch ;-)).

Ciao, Roberto

04/18/12 08:20:20 changed by seccanj

  • status changed from new to assigned.

Add/Change #9976 (Internal error with Postgresql database.)




Change Properties
Action