#3074 closed defect (fixed)
Various PostegreSQL errors on reports
Reported by: | izekia | Owned by: | Russ Tyndall |
---|---|---|---|
Priority: | normal | Component: | TimingAndEstimationPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
First three reports has a "ORDER BY 0" error in last row, as:
) AS tab ORDER BY 0 DESC LIMIT 100 OFFSET 0
and every report has a cast absence error in expression such as:
billable.value = 1
I've already solved second problem, by adding
CAST(billable.value AS INTEGER)
but still got first one.
Attachments (3)
Change History (13)
Changed 16 years ago by
Attachment: | cast_patch.patch added |
---|
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
What database backend are you using?
I was under the impression that all of the various CASTs that needed to be done were already being taken care of.
I will leave the ticket open until I get around to applying the patch.
Thanks for the patch, and for hunting down that trac bug.
Russ
comment:4 Changed 16 years ago by
I'm using PostgreSQL 8.3 db encoding = "utf-8" may be some misconfiguration in my case?
Trac 0.11rc1 + Genshi-0.5dev_r852-py2.5-win32.egg
Plugins: iniadmin 0.2 timingandestimationplugin 0.6.5 tracaccountmanager 0.2dev-r3554
Platform: Windows XP
comment:5 Changed 16 years ago by
Summary: | Various SQL errors on reports → Various PostegreSQL errors on reports |
---|
Probably not a misconfiguration. Postegres seems to be more strongly typed than the other database backends. It also seems not to be used as often for trac. It is also possible that this bug only occurs on this version of postgres, and that is why it has not been reported before. Either way it should not adversely effect any other db so I can safely apply that patch.
Thanks again for the good bug report.
Changed 16 years ago by
Attachment: | timingandestimationplugin_reports_py.diff added |
---|
PostgreSQL related fix
comment:7 Changed 16 years ago by
Hello, lads !
I've spotted similar issues on my installation, however i think that my solution is more generic, than explicit casts. Ticket_custom table has following structure:
Table "trac.ticket_custom" Column | Type | Modifiers --------+---------+----------- ticket | integer | not null name | text | not null value | text |
The column in question is value, as you see it has type text, so lets compare values as text strings, instead of casting them to integers. Also there's a trivial patch to report.py for Trac-0.11, which prevents "ORDER BY 0" issue. I am not sure, if there any open ticket, or should i create a new one and reattach it ?
Changed 16 years ago by
Attachment: | report_py.diff added |
---|
Trac-0.11 report.py patch - probably should be reattached to another ticket
comment:8 Changed 16 years ago by
Yes, it's seems that yours patch of timing and estimation reports is more correct then my one. And the "ORDER BY 0" issue already solved in trac r7131. I've already posted report about this issue.
comment:9 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 Changed 16 years ago by
(In [3785]) closes #3131
closes #3074
T&E(trac 10) 0.6.6
I brought the trac 10 branch up to the same version number of the plugin so that hopefully there is less confusion on my part about versions.
Fixes horrible bug relating to database access (due to my misunderstanding of which things were stateful in trac/python).
Fixed some bugs in the way billable values were being compared in the reports file (strong vs weak typed databases)
reports.py patch