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:
1) untar DBIx::SB's tarball
2) apply patch
3) install it
4) stop/start server
5) test, collect errors if any
6) reinstall clean DBIx::SB
7) stop/start server

On 10/10/07, Joop van de Wege <[EMAIL PROTECTED]> wrote:
> 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.
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>


-- 
Best regards, Ruslan.

Attachment: dbix-sb-oracle.patch
Description: Binary data

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to