Modify

Opened 15 years ago

Closed 14 years ago

#4705 closed defect (fixed)

WikiCssPlugin: PostgresSQL error with latest changeset

Reported by: Oliver Metz Owned by: Martin Scharrer
Priority: normal Component: WikiCssPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hi.

With last update (http://trac-hacks.org/changeset/5121) I get an error message in my log files:

2009-02-25 22:46:01,182 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:01,729 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:03,087 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:11,275 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:26,445 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:33,158 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:41,930 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:53,990 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:55,241 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden
2009-02-25 22:46:56,274 Trac[plugin] ERROR: FEHLER:  Spalte »wiki.version« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden

Sorry for the german language but I know it's no problem for you. ;-)

I reverted the change and everything seems to works fine.

Attachments (0)

Change History (8)

comment:1 Changed 15 years ago by Martin Scharrer

Status: newassigned

Could you try the following short patch:

  • wikicssplugin/0.11/tracwikicss/plugin.py

     
    4646            cursor.execute( \
    4747                "SELECT text, MAX(version) FROM wiki WHERE name='%s' " \
    48                 "GROUP BY text ORDER BY version DESC;" % self.wikipage )
     48                "GROUP BY text,version ORDER BY version DESC;" % self.wikipage )
    4949            content = cursor.fetchone()
    5050            if not content:

comment:2 Changed 15 years ago by Martin Scharrer

Sorry, the last line of the previous comment should be of course outside the text window. Here again the patch:

  • wikicssplugin/0.11/tracwikicss/plugin.py

     
    4646            cursor.execute( \
    4747                "SELECT text, MAX(version) FROM wiki WHERE name='%s' " \
    48                 "GROUP BY text ORDER BY version DESC;" % self.wikipage )
     48                "GROUP BY text,version ORDER BY version DESC;" % self.wikipage )
    4949            content = cursor.fetchone()
    5050            if not content:

comment:3 Changed 15 years ago by Oliver Metz

With this change the error has gone but the plugin doesn't seem to work anymore or uses a wrong version of css page.

comment:4 in reply to:  3 Changed 15 years ago by Martin Scharrer

I now simplified the SQL query ([5315]) to avoid the need for GROUP BY by kicking the unneeded MAX() out. Tell me if it works for you.

comment:5 Changed 15 years ago by Oliver Metz

Because there is only one column in the result now I needed the following change:

  • tracwikicss/plugin.py

     
    4949            content = cursor.fetchone()
    5050            if not content:
    5151                raise Exception("WikiCss: Configured wiki page '%s' doesn't exits." % self.wikipage)
    52             req.send(content[0], content_type='text/css', status=200)
     52            req.send(content, content_type='text/css', status=200)
    5353        except RequestDone:
    5454            pass
    5555        except Exception, e:

But now it works fine. Thank you.

comment:6 Changed 15 years ago by Martin Scharrer

Resolution: fixed
Status: assignedclosed

The fact when a scalar or a tuple is returned is still quite confusing for me. Python isn't my main programming language. I'm also not sure if this depends on the DB backend in this case. Therefore I put a simple test in ([5334]) to check if content is a tuple or not which is the most stable solution.

comment:7 Changed 14 years ago by Martin Scharrer

Resolution: fixed
Status: closedreopened

This should be reprogrammed to use the WikiPage model provided by Trac.

comment:8 Changed 14 years ago by Martin Scharrer

Resolution: fixed
Status: reopenedclosed

Fixed in [6951]. Now the WikiPage model of Trac is used which should make it completely compatible with all DB backends Trac itself supports.

Modify Ticket

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

Add Comment


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

 
Note: See TracTickets for help on using tickets.