[dev] Re: [cvs] commit: framework/DataTree/DataTree sql.php

Ben Chavet ben at chavet.net
Tue Aug 31 21:31:59 PDT 2004


I'm also having a simular problem with kronolith.

from my horde_log table:

404822 | 2004-08-31 23:28:45.363159 | HORDE            |        3 | 
[kronolith]
DB Error: unknown error: SELECT a1.datatree_id, c.datatree_name FROM
horde_datatree c LEFT JOIN horde_datatree_attributes a1 ON a1.datatree_id =
c.datatree_id WHERE c.group_uid = 'horde.shares.kronolith' AND
((a1.attribute_name = 'owner' AND a1.attribute_value = 'ben') OR
(a1.attribute_name = 'perm_users' AND a1.attribute_key = 'ben' AND CASE WHEN
CAST(a1.attribute_value AS VARCHAR) ~ '^-?[0-9]+$' THEN
(CAST(a1.attribute_value AS INTEGER) & 8) <> 0 ELSE FALSE END) OR
(a1.attribute_name = 'perm_creator' AND CASE WHEN CAST(a1.attribute_value AS
VARCHAR) ~ '^-?[0-9]+$' THEN (CAST(a1.attribute_value AS INTEGER) & 8) <> 0
ELSE FALSE END) OR (a1.attribute_name = 'perm_default' AND CASE WHEN
CAST(a1.attribute_value AS VARCHAR) ~ '^-?[0-9]+$' THEN
(CAST(a1.attribute_value AS INTEGER) & 8) <> 0 ELSE FALSE END))  AND
a1.attribute_name = a1.attribute_name GROUP BY a1.datatree_id ORDER BY
c.datatree_order, c.datatree_name, c.datatree_id [nativecode=ERROR:  column
"c.datatree_name" must appear in the GROUP BY clause or be used in an 
aggregate
function] [on line 906 of "/var/www/mail/kronolith/lib/Kronolith.php"]

Quoting Ben Chavet <ben at chavet.net>:

> Quoting Chuck Hagenbuch <chuck at horde.org>:
>
>> chuck       2004-08-31 12:19:28 PDT
>>
>>   Modified files:
>>     DataTree/DataTree    sql.php
>>   Log:
>>   Add a GROUP BY to prevent duplicate data.
>>
>>   Submitted by: duck at obala.net
>>
>>   Revision  Changes    Path
>>   1.139     +3 -3      framework/DataTree/DataTree/sql.php
>>
>>   Chora Links:
>>   
>> http://cvs.horde.org/diff.php/framework/DataTree/DataTree/sql.php?r1=1.138&r2=1.139&ty=u
>>
>> --
>> To unsubscribe, mail: cvs-unsubscribe at lists.horde.org
>>
>>
>
>
> this, or one of the other recent changes, broke my datatree.  I use
> postgresql,
> and when I try to get a gallery listing in ansel, it generates the following
> query:
>
> www=# SELECT a1.datatree_id, c.datatree_name FROM horde_datatree c LEFT JOIN
> horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id WHERE
> c.group_uid = 'horde.shares.ansel' AND ((a1.attribute_name = 'owner' AND
> a1.attribute_value = 'admin') OR (a1.attribute_name = 'perm_users' AND
> a1.attribute_key = 'admin' AND CASE WHEN CAST(a1.attribute_value AS 
> VARCHAR) ~
> '^-?[0-9]+$' THEN (CAST(a1.attribute_value AS INTEGER) & 2) <> 0 ELSE FALSE
> END) OR (a1.attribute_name = 'perm_creator' AND CASE WHEN
> CAST(a1.attribute_value AS VARCHAR) ~ '^-?[0-9]+$' THEN
> (CAST(a1.attribute_value AS INTEGER) & 2) <> 0 ELSE FALSE END) OR
> (a1.attribute_name = 'perm_default' AND CASE WHEN CAST(a1.attribute_value AS
> VARCHAR) ~ '^-?[0-9]+$' THEN (CAST(a1.attribute_value AS INTEGER) & 2) <> 0
> ELSE FALSE END)) AND datatree_parents = '' AND a1.attribute_name =
> a1.attribute_name GROUP BY a1.datatree_id ORDER BY c.datatree_order,
> c.datatree_name, c.datatree_id;
>
> which returns the following error:
>
> ERROR:  column "c.datatree_name" must appear in the GROUP BY clause 
> or be used
> in an aggregate function
>
> I would look into it myself, but this SQL statement is WAY above me :)
> Any help
> would be appreciated.
>
> --Ben
>
> --
> Horde developers mailing list - Join the hunt: http://horde.org/bounties/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>
>




More information about the dev mailing list