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.
Itās an experimental and untested patch that may help.
When a query has a āgroup byā part we really donāt want to make it
distinct as I donāt see any way it can have not unique entries in the
result set.
Patch is for DBIx::SearchBuilder, to try it use the following steps:
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.