[Date Prev][Date Next] [Chronological] [Thread] [Top]

back-sql filter problem (ITS#2102)



Full_Name: Aldo Armiento
Version: 2.1.5
OS: Linux RedHat 7.1
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (213.255.18.40)


When i make a search like this:

ldapsearch  -LLL -h myhost.com -b 'c=it' '(|(cn=A*)(given-name=A*))'

in trace I have:

SRCH "c=it" 2 0    0 0 0
ber_scanf fmt ({m) ber:
ber_scanf fmt (m) ber:
ber_scanf fmt ({m) ber:
ber_scanf fmt (x) ber:
get_filter: unknown filter type=48
    filter: (|(cn=A*)(?=undefined)(?=undefined))
ber_scanf fmt ({M}}) ber:
    attrs:
==>backsql_search(): base='c=it', filter='(|(cn=A*)(?=undefined)(?=undefined))',
scope=2, deref=0, attrsonly=0, attributes to load: all

And the constructed query is:

<==backsql_srch_query()
Constructed query: SELECT DISTINCT
ldap_entries.id,persons.id,'organizationalPerson' AS objectClass,ldap_entries.dn
AS dn FROM ldap_entries,persons WHERE persons.id=ldap_entries.keyval AND
ldap_entries.oc_map_id=? AND UPPER(ldap_entries.dn) LIKE UPPER(?) AND
((UPPER(CONCAT(persons.Nome,' ',persons.Cognome)) LIKE 'A%') OR  OR )
dn '%C=IT'

and, obviously:

backsql_oc_get_candidates(): error executing query
Return code: -1
Native error code: 1064
SQL engine state: 42000
Message: [MySQL][ODBC 3.51 Driver][mysqld-4.0.1-alpha-log]You have an error in
your SQL syntax near 'OR )' at line 1