Opened 11 years ago

Closed 11 years ago

#1697 closed defect (invalid)

Hour reports not working with Trac 10.4 & MySQL 5.0

Reported by: duckie@… Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10


E.g. when opening 'ticket hours grouped by component' report the following error message appears:

Report execution failed: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REAL) as Estimated_work,\n CAST(totalhours.value as REAL) as Total_work,\n ' at line 11")

This error seems to be related to the fact that MySQL doesn't support casting to REAL. (

I haven't had time to test it yet but I guess the problem could be solved by replacing REAL with DECIMAL.

Attachments (1)

Il bisbetico (69.5 KB) - added by anonymous 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by Russ Tyndall


I was really hoping that we had finally worked up reports that were reliably cross database </grumble>.

I just tested casting as decimal in sqlite, mysql5, and a recent version of postgres and it worked so I will change the reports, and post a new version of the plugin in a few moments (it will show up in this log when I do).

Thanks for the good bug report,


comment:2 Changed 11 years ago by Russ Tyndall

(In [2331]) re #1697

Changed REAL to DECIMAL in all reports and bumped the version number up to 0.4.2

comment:3 Changed 11 years ago by anonymous

Resolution: fixed
Status: newclosed

comment:4 Changed 11 years ago by anonymous

Resolution: fixed
Status: closedreopened

MySQL 5.0 does not like the "CAST( as text) as ticket" in developers work summary.

Fixed by changing to " as ticket" which is used also in milestone work summary

comment:5 Changed 11 years ago by anonymous

Your fix will not work for strongly typed databases (read postgres) because it wants the union to be of the same type. I will attempt to find a valid cross database type to cast to.

I may not get to this for a few days. Thanks for the bug report,


comment:6 Changed 11 years ago by Russ Tyndall

Resolution: fixed
Status: reopenedclosed

closes #1697 I was wrong about this, It was just a leftover quirk and has been removed

closes #901 reports now contain time remaining

closes #1958 added case statements all over the place to better support postegres when there are null/empty values

closes #1959 changed the work summary report to include links to the ticket and ticket summaries

Now at version 0.4.9

comment:7 Changed 11 years ago by idbill@…

Resolution: fixed
Status: closedreopened

I am having this problem.

What was the fix?

Trac 0.10.4 + mySQL 5.0.48 + TimeAndEstimationPlugin 0.4.9


comment:8 Changed 11 years ago by anonymous

Resolution: invalid
Status: reopenedclosed

nm this isn't a cast issue... but a problem with mysql5.0 nevertheless.

Changed 10 years ago by anonymous

Attachment: Il bisbetico added

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Russ Tyndall.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.