[Rt-devel] database syntax issue in date-based charts

Roedel, Mark MarkRoedel at letu.edu
Mon Jan 28 15:49:07 EST 2008


When generating a date-based chart from a search result (for example,
with a ResolvedMonthly grouping), the _FieldToFunction subroutine in
Lib/RT/Report/Tickets.pm generates SUBSTR() statements for the query.

However, MySQL prior to 4.1.1 does not recognize the SUBSTR() function,
requiring instead a SUBSTRING().
(http://dev.mysql.com/doc/refman/4.1/en/string-functions.html#function_s
ubstr documents the addition of SUBSTR() as an alias to SUBSTRING() with
that release.)

(Yes, we should upgrade, but since the RT wiki recommends MySQL 4.0.18
or newer, it seemed worth pointing out the gap in functionality.  For
anyone else who runs into the same problem -- you'll know because of the
SQL syntax errors in your logs as well as by those graphs never showing
any data -- as of v3.6.6 the lines that need to be changed in Tickets.pm
are 178, 181 and 184.)


--
Mark Roedel
Senior Programmer / Analyst
LeTourneau University
Longview, Texas  USA


More information about the Rt-devel mailing list