Issue 7193 - SQL backend lost part of data on request
Summary: SQL backend lost part of data on request
Status: VERIFIED SUSPENDED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: backends (show other issues)
Version: 2.4.30
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-02 14:33 UTC by barlone@yandex.ru
Modified: 2020-06-25 23:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description barlone@yandex.ru 2012-03-02 14:33:20 UTC
Full_Name: barlone
Version: 2.4.30
OS: FreeBSD 7.3
URL: 
Submission from: (NULL) (217.12.195.21)


Good day. 

I have MySQL database (server 5.5.20) which contain data about peoples and
organizations. (Dump of this database and others files I have place on our ftp
server: ftp://46.28.65.114 user: alien password: neversaynever - read only
access).

We need to get from LDAP accounts of peoples and organizations which have email
(to Mozilla Thunderbird mail client).

I setup OpenLDAP server with SQL backend, unixODBC etc. This bridge work, but
have serious problem - slapd gives not all objects. I record to openldap.log
full trace of loading slapd, connection of LDAP browser (Apache Directory
Studio) and searching the request with base: "dc=ffsua,dc=com" and filter:
"(mail=*@*)". At line #1432 backend-sql construct and run such query:

SELECT DISTINCT ldap_entries.id, orgs.id, 'ffsOrganization' AS objectClass,
ldap_entries.dn AS dn
FROM
  ldap_entries, orgs
WHERE
  orgs.id = ldap_entries.keyval
  AND ldap_entries.oc_map_id = 2
  AND 9 = 9
  AND orgs.omail IS NOT NULL
  AND (upper(orgs.omail) LIKE '%@%')

Further in the log can be seen that backend-sql retrieves 19 records, but really
in database - 22 suitable records (records with id=83,92,93 losted, look to file
sql_query_result.csv). But if we watch in LDAP browser, we seen 17(!) records -
look to file ldap_search_result.csv, lines with o=...

I can not understand the principle on which the records drop out...

Please answer, what are your opportunity to address this problem. If you have
not - I'd rather know about it immediately - I will have to deal with the
source.

P.S. Sorry for my English...
Comment 1 barlone@yandex.ru 2012-03-02 16:44:37 UTC
Good day!

I found some hint:

if define BACKSQL_ARBITRARY_KEY in back-sql.h, then all records presents in search result,

BUT LDAP entry do not contain any attribute! Just empty. Maybe it is another bug?

------------------------------------------
Best regards,
mailto:barlone@yandex.ru


Comment 2 barlone@yandex.ru 2012-03-02 17:36:25 UTC
Good day!

I found problem: function under macro BACKSQL_STR2ID incorrectly work with 'zerofilled' values/fields (for example "000009")

------------------------------------------
Best regards,
mailto:barlone@yandex.ru


Comment 3 Quanah Gibson-Mount 2017-03-29 22:46:50 UTC
moved from Incoming to Software Bugs
Comment 4 Quanah Gibson-Mount 2020-06-25 23:26:31 UTC
patches welcome