Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

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

cast_patch.patch (8.2 KB) - added by izekia 16 years ago.
reports.py patch
timingandestimationplugin_reports_py.diff (3.2 KB) - added by Valery Masiutsin 16 years ago.
PostgreSQL related fix
report_py.diff (454 bytes) - added by Valery Masiutsin 16 years ago.
Trac-0.11 report.py patch - probably should be reattached to another ticket

Download all attachments as: .zip

Change History (13)

Changed 16 years ago by izekia

Attachment: cast_patch.patch added

reports.py patch

comment:1 Changed 16 years ago by izekia

second error caused by this trac error

comment:2 in reply to:  1 Changed 16 years ago by izekia

Replying to izekia:

second error caused by this trac error

i mean fisrt, of course )

comment:3 Changed 16 years ago by Russ Tyndall

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

comment:5 Changed 16 years ago by Russ Tyndall

Summary: Various SQL errors on reportsVarious 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.

comment:6 Changed 16 years ago by izekia

not at all, id like to make trac better)

Changed 16 years ago by Valery Masiutsin

PostgreSQL related fix

comment:7 Changed 16 years ago by Valery Masiutsin

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 Valery Masiutsin

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 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.

comment:9 Changed 16 years ago by Russ Tyndall

Resolution: fixed
Status: newclosed

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

comment:10 Changed 16 years ago by Russ Tyndall

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Russ Tyndall.
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.