Bugs #2701: SQL Error

Ticket modified by Tracking System at 2011/02/07 16:01
Tracking System: Bugs
Category: Calendar
Version: Trunk

Status: Closed
Resolution: None
Completed: 10%
Priority: 5 - medium
Created By: Lars Boegild Thomsen
Created on: 2010/07/26 17:32
Assigned to: not assigned
Summary: #2701 - SQL Error
When syncronizing with syncevolution latest trunk (this worked a few month back):

Invalid SQL: SELECT DISTINCT egw_addressbook.contact_id AS id,egw_addressbook.account_id as account_id,egw_addressbook.n_fn AS n_fn FROM egw_addressbook LEFT JOIN egw_addressbook_extra ON egw_addressbook.contact_id=egw_addressbook_extra.contact_id WHERE contact_tid != ‘D’ AND egw_addressbook.contact_owner != 0 AND (egw_addressbook.contact_owner=1002 OR contact_private=0 AND egw_addressbook.contact_owner IN (1208,1002,0) OR egw_addressbook.contact_owner IS NULL) AND (n_fn=‘Lars Boegild Thomsen’) ORDER BY egw_addressbook.account_id IS NOT NULL DESC, n_fn IS NOT NULL DESC:
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list


Comment by Tracking System at 2011/02/07 16:01:
This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days.


Comment by Birgit Becker at 2011/01/24 15:27:
Hi Lars,

is this ticket still valid or solved?

Birgit

Comment by Lars Boegild Thomsen at 2010/08/10 05:10:
This error definitely originates from class.calendar_ical.inc.php - so perhaps it should be moved to a different category.

If I make this change it’s working:

x330:/usr/local/egroupware/calendar/inc# svn diff
Index: class.calendar_ical.inc.php

— class.calendar_ical.inc.php (revision 31646)
+++ class.calendar_ical.inc.php (working copy)
@@ -2786,7 +2786,7 @@
}
elseif ((list($data) = $this->addressbook->search($searcharray,
array(‘id’,‘egw_addressbook.account_id as account_id’,‘n_fn’),

  •                                                   'egw_addressbook.account_id IS NOT NULL DESC, n_fn IS NOT NULL DESC',
    
  •                                                   'egw_addressbook.account_id, n_fn',
                                                      '','',false,'OR')))
                                              {
                                                      // found an addressbook entry
    

@@ -3068,4 +3068,4 @@

            return $vcal->exportvCalendar($charset);
    }

-}
\ No newline at end of file
+}


Comment by Lars Boegild Thomsen at 2010/08/04 11:50:
Any idea which commit created this problem? I have been trying to roll back - but I don’t seem to be able to find a version that works now.

Comment by Lars Boegild Thomsen at 2010/07/27 08:03:
I was browsing through those files but I couldn’t locate where this particular statement originates.

Comment by Lars Boegild Thomsen at 2010/07/27 04:20:
No, sorry I didn’t mention that - it’s PostgreSQL.

Comment by Jörg Lehrke at 2010/07/26 20:28:
The problem is cause by an invalid SQL statement in the BO class. I guess it is not a MySQL installation.

linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2701&no_popup=1