I’m trying to draw charts grouped by customfield (using the
functionnality at the bottom of a search result) and on a customfiled of
type “select unique value”. But the result graph is empty
It works with other group by like status, queue, …
If someone has some hints on solving this … thank you!
I’m trying to draw charts grouped by customfield (using the
functionnality at the bottom of a search result) and on a customfiled of
type “select unique value”. But the result graph is empty
It works with other group by like status, queue, …
If someone has some hints on solving this … thank you!
I forgot … I’m using the latest RT 3.6.5 on RH CentOS 5 with Oracle XE
10.
what shows up in your error logs?------- Original message -------
From: Emmanuel Lacour elacour@easter-eggs.com
Sent: 10-10-'07, 3:43
Dear RT users/developpers
I’m trying to draw charts grouped by customfield (using the
functionnality at the bottom of a search result) and on a customfiled of
type “select unique value”. But the result graph is empty
It works with other group by like status, queue, …
If someone has some hints on solving this … thank you!
That’s the good question … sorry I forgot to look here
There is DBD prepare errors:
RT: RT::Handle=HASH(0x8134df1c) couldn’t prepare the query 'SELECT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM ( SELECT DISTINCT main.id FROM Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ( ObjectCustomFieldValues_1.CustomField = ‘1’ ) AND ( ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’ ) AND ( ObjectCustomFieldValues_1.Disabled = ‘0’ ) AND ( ObjectCustomFieldValues_1.ObjectId = main.id ) WHERE (main.Status != ‘deleted’) AND (main.Status != ‘resolved’) AND (main.Type = ‘ticket’) AND (main.EffectiveId = main.id) ) distinctquery, Tickets main WHERE (main.id = distinctquery.id) GROUP BY ObjectCustomFieldValues_1.Content
'ORA-00904: “OBJECTCUSTOMFIELDVALUES_1”.“CONTENT”: invalid identifier
(DBD ERROR: error possibly near <*> indicator at char 596 in 'SELECT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM ( SELECT DISTINCT main.id FROM Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
If I use the same query on mysql 9without the comma…) I get:
ERROR 1054 (42S22): Unknown column ‘ObjectCustomFieldValues_1.Content’ in ‘field list’
And the oracle error 904 is “invalid column name” too
Here is the SQL for the same Graph on a MySQL RT, gived by StatementLog (graph by CustomFields works with MySQL):
SELECT DISTINCT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM (Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ((ObjectCustomFieldValues_1.CustomField = ‘1’)) AND ( (ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’)) AND ( (ObjectCustomFieldValues_1.Disabled = ‘0’)) AND ( ObjectCustomFieldValues_1.ObjectId = main.id)) WHERE ((main.EffectiveId = main.id)) AND ((main.Status != ‘deleted’)) AND ((main.Type = ‘ticket’)) AND ((main.Created < ‘2007-10-31 23:00:00’) AND (main.Created > ‘2007-09-29 22:00:00’)) GROUP BY ObjectCustomFieldValues_1.Content ;
and the one for the Oracle RT:
SELECT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM ( SELECT DISTINCT main.id FROM Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ( ObjectCustomFieldValues_1.CustomField = ‘1’ ) AND ( ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’ ) AND ( ObjectCustomFieldValues_1.Disabled = ‘0’ ) AND ( ObjectCustomFieldValues_1.ObjectId = main.id ) WHERE (main.Status != ‘deleted’) AND (main.Status != ‘resolved’) AND (main.Type = ‘ticket’) AND (main.EffectiveId = main.id) ) distinctquery, Tickets main WHERE (main.id = distinctquery.id) GROUP BY ObjectCustomFieldValues_1.Content
;
I suspect that it has to do with “this was tested on mysql and pg”
Any oracle folks see what we’re doing wrong with that SQL?
There is DBD prepare errors:
RT: RT::Handle=HASH(0x8134df1c) couldn’t prepare the query 'SELECT
COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM (
SELECT DISTINCT main.id FROM Tickets main LEFT JOIN
ObjectCustomFieldValues ObjectCustomFieldValues_1 ON (
ObjectCustomFieldValues_1.CustomField = ‘1’ ) AND (
ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’ ) AND (
ObjectCustomFieldValues_1.Disabled = ‘0’ ) AND (
ObjectCustomFieldValues_1.ObjectId = main.id ) WHERE (main.Status !=
‘deleted’) AND (main.Status != ‘resolved’) AND (main.Type = ‘ticket’)
AND (main.EffectiveId = main.id) ) distinctquery, Tickets main WHERE
(main.id = distinctquery.id) GROUP BY ObjectCustomFieldValues_1.Content
Problem is that in the group by there is a alias which is defined in the
subquery.
ObjectCustomFieldValues_1 is only known in the innermost query not the
outer one.
There is another problem aswell since modifing the query gives me
another unidentified error.
I’ll see if my DBA can have a look at it.
Emmanuel Lacour wrote:> On Wed, Oct 10, 2007 at 05:46:31PM +0200, Gianluca Cecchi wrote:
Sorry main was an alias for Tickets table…
If I use the same query on mysql 9without the comma…) I get:
ERROR 1054 (42S22): Unknown column ‘ObjectCustomFieldValues_1.Content’ in ‘field list’
And the oracle error 904 is “invalid column name” too
Here is the SQL for the same Graph on a MySQL RT, gived by StatementLog (graph by CustomFields works with MySQL):
SELECT DISTINCT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM (Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ((ObjectCustomFieldValues_1.CustomField = ‘1’)) AND ( (ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’)) AND ( (ObjectCustomFieldValues_1.Disabled = ‘0’)) AND ( ObjectCustomFieldValues_1.ObjectId = main.id)) WHERE ((main.EffectiveId = main.id)) AND ((main.Status != ‘deleted’)) AND ((main.Type = ‘ticket’)) AND ((main.Created < ‘2007-10-31 23:00:00’) AND (main.Created > ‘2007-09-29 22:00:00’)) GROUP BY ObjectCustomFieldValues_1.Content ;
Weird, this one works without modification on Oracle XE.
On Wed, Oct 10, 2007 at 05:46:31PM +0200, Gianluca Cecchi wrote:
Sorry main was an alias for Tickets table…
If I use the same query on mysql 9without the comma…) I get:
ERROR 1054 (42S22): Unknown column ‘ObjectCustomFieldValues_1.Content’ in ‘field list’
And the oracle error 904 is “invalid column name” too
Here is the SQL for the same Graph on a MySQL RT, gived by StatementLog (graph by CustomFields works with MySQL):
SELECT DISTINCT COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM (Tickets main LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ((ObjectCustomFieldValues_1.CustomField = ‘1’)) AND ( (ObjectCustomFieldValues_1.ObjectType = ‘RT::Ticket’)) AND ( (ObjectCustomFieldValues_1.Disabled = ‘0’)) AND ( ObjectCustomFieldValues_1.ObjectId = main.id)) WHERE ((main.EffectiveId = main.id)) AND ((main.Status != ‘deleted’)) AND ((main.Type = ‘ticket’)) AND ((main.Created < ‘2007-10-31 23:00:00’) AND (main.Created > ‘2007-09-29 22:00:00’)) GROUP BY ObjectCustomFieldValues_1.Content ;
Weird, this one works without modification on Oracle XE.
On Thu, Oct 11, 2007 at 06:44:04AM +0400, Ruslan Zakirov wrote:
It’s an experimental and untested patch that may help.
It helps, and works here :))
Thanks you very much!
That’s cool, let it spin for several days… And may be during next
week we’ll release new version of SB.
Joop, any comments?
Haven’t had time to try the patch on our test instance and don’t know
when I will. Might be somewhere next week.
The patch looks clean to me and if that statement that worked is the
result of this patch then it looks certainly OK.
The patch is in DBIx::SearchBuilder 1.50 which on its way to the CPAN.
It will be available from mirrors soon.On Oct 11, 2007 11:08 PM, Joop van de Wege JoopvandeWege@mococo.nl wrote:
On Thu, Oct 11, 2007 at 06:44:04AM +0400, Ruslan Zakirov wrote:
It’s an experimental and untested patch that may help.
It helps, and works here :))
Thanks you very much!
That’s cool, let it spin for several days… And may be during next
week we’ll release new version of SB.
Joop, any comments?
Haven’t had time to try the patch on our test instance and don’t know
when I will. Might be somewhere next week.
The patch looks clean to me and if that statement that worked is the
result of this patch then it looks certainly OK.