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

Re: back-sql



Uwe Hering writes:

Hi,

I'm just trying to use openldap in connection with mysql, that is
using back-sql.


Version are:

openldap-2.1.4
MyODBC-2.50.39
unixODBC-2.1.1


Checking the examples unter ..../rdbms_depend/mysql there where
three problems, one is left.


First problem was a missing attribute "documentDN" within the schema
definition which has been used within the mysql tables. Just
deleting the line within the database was okay since it is obviously not used.


Second problem was that in addition to the manpage a column called
"sel_expr_u" is used within the standard "at_query". Adding this
column to the table helped (stating the "at_query" without this
column within slapd.conf should also work).


Third problem is: if I do any search within the ldap I get nothing
back. Since slapd -d 5 did not show up any errors or problems, examining the mysql-logfile revealed an interesting detail:


any sql-query showed similar:

SELECT DISTINCT ldap_entries.id,persons.id,'inetOrgPerson' AS
objectClass,ldap_entries.dn AS dn FROM ldap_entries,persons WHERE
persons.id=ldap_entries.keyval AND ldap_entries.oc_map_id=1 AND
ldap_entries.dn LIKE CONCAT('%','UR=C,LQS=O%') AND NOT
('inetOrgPerson' IS NULL)



I assume that the string "LIKE CONCAT('%','UR=C,LQS=O%')" ist not
correct. Changing it to "LIKE CONCAT('%','O=SQL,C=RU%')" works
within mysql properly.



Does anybody know wether this might be a configuration problem or could it be a source problem (openldap | unixODBC | MySQLODBC)?

Late versions of back-sql before it was ported to 2.1 contained
some auto-detection of exoteric features of specific RDBMSes,
inclusing this reverse uppercased (ru) dnstore and lookup
(as you see, the DN you're searching for is written from right
to left ...). Unfortunately this is not consistently used
throughout the code, or there's something that I'm missing.
To avoid the problem, you should explicitly tell back-sql
you don't want to use such feature by adding


has_ldapinfo_dn_ru no

to slapd.conf (as stated in slapd-sql(5) in current HEAD,
dunno if it is already there in 2.1.4 man page but surely is
in 2.1.4 code).


This directive is subjected to change, and it is mainly meant
as a temporary workaround for failures in auto-detecting the
sql side arrangement.


Pierangelo.

Dr. Pierangelo Masarati | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale | fax: +39 02 2399 8334
Politecnico di Milano | mailto:pierangelo.masarati@polimi.it
via La Masa 34, 20156 Milano, Italy | http://www.aero.polimi.it/~masarati