Opened 16 years ago
Closed 15 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 16 years ago by
Status: | new → assigned |
---|
comment:2 Changed 16 years ago by
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
46 46 cursor.execute( \ 47 47 "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 ) 49 49 content = cursor.fetchone() 50 50 if not content:
comment:3 follow-up: 4 Changed 16 years ago by
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 Changed 16 years ago by
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 16 years ago by
Because there is only one column in the result now I needed the following change:
-
tracwikicss/plugin.py
49 49 content = cursor.fetchone() 50 50 if not content: 51 51 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) 53 53 except RequestDone: 54 54 pass 55 55 except Exception, e:
But now it works fine. Thank you.
comment:6 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This should be reprogrammed to use the WikiPage model provided by Trac.
comment:8 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in [6951]. Now the WikiPage model of Trac is used which should make it completely compatible with all DB backends Trac itself supports.
Could you try the following short patch:
wikicssplugin/0.11/tracwikicss/plugin.py
ORDER BY version DESC;" % self.wikipage )