Ticket #3074 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Various PostegreSQL errors on reports

Reported by: izekia Assigned to: bobbysmith007
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

cast_patch.patch (8.2 kB) - added by izekia on 05/26/08 07:32:21.
reports.py patch
timingandestimationplugin_reports_py.diff (3.2 kB) - added by wally on 06/03/08 01:37:15.
PostgreSQL related fix
report_py.diff (454 bytes) - added by wally on 06/03/08 01:48:53.
Trac-0.11 report.py patch - probably should be reattached to another ticket

Change History

05/26/08 07:32:21 changed by izekia

  • attachment cast_patch.patch added.

reports.py patch

(follow-up: ↓ 2 ) 05/26/08 08:13:34 changed by izekia

second error caused by this trac error

(in reply to: ↑ 1 ) 05/26/08 08:15:37 changed by izekia

Replying to izekia:

second error caused by this trac error

i mean fisrt, of course )

05/26/08 09:33:25 changed by bobbysmith007

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

05/26/08 09:48:32 changed by izekia

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

05/26/08 09:59:59 changed by bobbysmith007

  • summary changed from Various SQL errors on reports to 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.

05/26/08 10:09:26 changed by izekia

not at all, id like to make trac better)

06/03/08 01:37:15 changed by wally

  • attachment timingandestimationplugin_reports_py.diff added.

PostgreSQL related fix

06/03/08 01:47:32 changed by wally

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 ?

06/03/08 01:48:53 changed by wally

  • attachment report_py.diff added.

Trac-0.11 report.py patch - probably should be reattached to another ticket

06/04/08 01:45:52 changed by izekia

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.

06/04/08 08:30:59 changed by bobbysmith007

  • status changed from new to closed.
  • resolution set to fixed.

(In [3784]) closes #3131
closes #3074
T&E 0.6.6

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 week typed databases)

06/04/08 08:36:01 changed by bobbysmith007

(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)


Add/Change #3074 (Various PostegreSQL errors on reports)




Change Properties
Action