On Mon, 2005-11-21 at 19:38 +0000, Seb James wrote: > Here is the query which backsql_srch_query() contructs: > > 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=? > AND ldap_entries.dn LIKE ? > AND ( LIKE 'MITYA%')
this is NOT valid SQL, as far as I can tell. > > The problem is in the last line. I don't know enough sql to tell if this > could be valid sql on another rdbms, but if I change the last line to > > AND (cn LIKE 'MITYA%') > > Then the query will run. That's how it should be. > > I note that mysql isn't terribly well used with back-sql, or at least > the maintainers of back-sql don't have enough time to test with mysql. > > Is there anything I can add to my metadata to have the 'cn' added to > that search query, or do I need to hack backsql_srch_query() in search.c > in the back-sql code? I suggest you file an ITS. You say (and it appears from the data) that this happens with the examples that come with OpenLDAP; this definitely looks like a bug, whether or not specific to (that version of) MySQL. Unless you're using an "ancient" version (anything before 2.3.12 ;) you should file an ITS <http://www.openldap.org/its/> and provide as many details as possible about how to reproduce it (e.g. what search parameters did you use?). I'll note in advance that back-sql in OpenLDAP 2.2 is not maintained, as it changed so much when moving to 2.3 that digging out issues would be a real pain, unless they're really trivial. OpenLDAP 2.3 comes with a (yet limited) suite of tests that helps tracking issues and regessions; you need to manually run it, as it requires some non-trivial work to setup the RDBMS and the ODBC. p. Ing. Pierangelo Masarati Responsabile Open Solution SysNet s.n.c. Via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ------------------------------------------ Office: +39.02.23998309 Mobile: +39.333.4963172 Email: [EMAIL PROTECTED] ------------------------------------------
