[turba] imp name expansion - turba sql problem

Liam Hoekenga liamr@umich.edu
Sat, 17 Aug 2002 03:04:58 -0400


I want to do a strict match against 'object_alias' (ie the "Alias" / "Nickname"
field in my sql addressbook).  If if I do add "object_alias" to the "strict"
array, I think it's throwing an "AND" where I should have an "OR".

something like:

    select ... from turba_objects where 
    (object_alias = 'alias' AND owner_id = 'liamr') 
    AND ( object_name like '%alias%'))

instead of:

    select ... from turba_objects where 
    (owner_id = 'liamr')
    AND ((object_alias = 'alias')
    OR (object_name like '%alias%'))


Here's the query I get when I've got 

    'strict' => array(
        'object_id',
        'object_alias'
    )

set in sources.php...

Aug 17 02:51:05 HORDE [debug] [turba] SQL search by liamr: table =
turba_objects; query = "SELECT object_id, owner_id, object_name, object_email,
object_alias, object_homeAddress, object_workAddress, object_homePhone,
object_workPhone, object_cellPhone, object_fax, object_title, object_company,
object_notes FROM turba_objects WHERE  (object_alias = 'clunis' AND owner_id =
'liamr') AND  (LOWER(object_name) LIKE LOWER('%clunis%'))" [on line 122 of
"/usr/local/projects/webmail/html-ssl/horde-2.1UM/turba/lib/Driver/sql.php"]

Here's the query I get when I've got:

    'strict' => array(
        'object_id'
    )

in sources.php...

Aug 17 02:52:56 HORDE [debug] [turba] SQL search by liamr: table =
turba_objects; query = "SELECT object_id, owner_id, object_name, object_email,
object_alias, object_homeAddress, object_workAddress, object_homePhone,
object_workPhone, object_cellPhone, object_fax, object_title, object_company,
object_notes FROM turba_objects WHERE  (owner_id = 'liamr') AND 
(LOWER(object_alias) LIKE LOWER('%clunis%')  OR LOWER(object_name) LIKE
LOWER('%clunis%'))" [on line 122 of
"/usr/local/projects/webmail/html-ssl/horde-2.1UM/turba/lib/Driver/sql.php"]


Liam