Issue 8630 - back-sql: Objectclass name being overwritten when loading schema
Summary: back-sql: Objectclass name being overwritten when loading schema
Status: VERIFIED SUSPENDED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: backends (show other issues)
Version: 2.4.44
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 06:30 UTC by thomas.fazekas@gmail.com
Modified: 2020-06-25 23:33 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 thomas.fazekas@gmail.com 2017-04-04 06:30:26 UTC
Full_Name: Thomas Fazekas
Version: 2.4.44
OS: raspbian
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (213.181.38.213)


My system info :
Linux berry 4.4.34+ #930 Wed Nov 23 15:12:30 GMT 2016 armv6l GNU/Linux 
(raspberry pi 3 with latest raspbian)
openldap 2.4.44 built from sources : "./configure --prefix=/opt/openldap-2.4.44
--enable-sql"
Mysql deployed from repository : 5.5.54-0+deb8u1 (Raspbian)

followed the mysql specific README from the rdbms sources folder (created the
db, schema & test data)

Now, when I try to start-up the server I get :

58e33726 backend_startup_one: starting "dc=berry,dc=office,dc=company,dc=com"
58e33726 ==>backsql_db_open(): testing RDBMS connection
58e33726 backsql_db_open(): concat func not specified (use "concat_pattern"
directive in slapd.conf)
58e33726 backsql_db_open(): children search SQL condition not specified (use
"children_cond" directive in slapd.conf); preparing default
58e33726 backsql_db_open(): setting "ldap_entries.dn LIKE CONCAT('%,',?)" as
default "children_cond"
58e33726 backsql_db_open(): DN match search SQL condition not specified (use
"dn_match_cond" directive in slapd.conf); preparing default
58e33726 backsql_db_open(): setting "ldap_entries.dn=?" as default
"dn_match_cond"
58e33726 backsql_db_open(): objectclass mapping SQL statement not specified (use
"oc_query" directive in slapd.conf)
58e33726 backsql_db_open(): setting "SELECT
id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
ldap_oc_mappings" by default
58e33726 backsql_db_open(): attribute mapping SQL statement not specified (use
"at_query" directive in slapd.conf)
58e33726 backsql_db_open(): setting "SELECT
name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return,sel_expr_u
FROM ldap_attr_mappings WHERE oc_map_id=?" by default
58e33726 backsql_db_open(): entry deletion SQL statement not specified (use
"delentry_stmt" directive in slapd.conf)
58e33726 backsql_db_open(): setting "DELETE FROM ldap_entries WHERE id=?" by
default
58e33726 backsql_db_open(): entry deletion SQL statement not specified (use
"renentry_stmt" directive in slapd.conf)
58e33726 backsql_db_open(): setting "UPDATE ldap_entries SET
dn=?,parent=?,keyval=? WHERE id=?" by default
58e33726 backsql_db_open(): objclasses deletion SQL statement not specified (use
"delobjclasses_stmt" directive in slapd.conf)
58e33726 backsql_db_open(): setting "DELETE FROM ldap_entry_objclasses WHERE
entry_id=?" by default
58e33726 ==>backsql_get_db_conn()
58e33726 ==>backsql_open_db_handle()
58e33726 <==backsql_open_db_handle()
58e33726 <==backsql_get_db_conn()
58e33726 ==>backsql_load_schema_map()
58e33726 backsql_load_schema_map(): oc_query "SELECT
id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
ldap_oc_mappings"
58e33726 objectClass: id="1" name="inetOrgPerson" keytbl="persons" keycol="id"
create_proc="" create_keyval="" delete_proc="" expect_return="0"create_hint="" 
58e33726 backsql_load_schema_map(): objectClass "inetOrgPerson":
    keytbl="persons" keycol="id"
58e33726     expect_return: add=0, del=0; attributes:
58e33726 objectClass: id="2" name="documenterson" keytbl="documents" keycol="id"
create_proc="" create_keyval="" delete_proc="" expect_return="0"create_hint="" 
58e33726 backsql_load_schema_map(): objectClass "documenterson" is not defined
in schema
58e33726 backsql_db_open(): schema mapping failed, exiting
58e33726 backend_startup_one (type=sql,
suffix="dc=berry,dc=office,dc=company,dc=com"): bi_db_open failed! (1)
58e33726 slapd shutdown: initiated
58e33726 ==>backsql_db_close()
58e33726 <==backsql_db_close()
58e33726 slapd destroy: freeing system resources.

My related DB content :
mysql> select * from ldap_oc_mappings;
+----+---------------+------------+--------+-------------+-------------+---------------+
| id | name          | keytbl     | keycol | create_proc | delete_proc |
expect_return |
+----+---------------+------------+--------+-------------+-------------+---------------+
|  1 | inetOrgPerson | persons    | id     | NULL        | NULL        |        
    0 |
|  2 | document      | documents  | id     | NULL        | NULL        |        
    0 |
|  3 | organization  | institutes | id     | NULL        | NULL        |        
    0 |
|  4 | referral      | referrals  | id     | NULL        | NULL        |        
    0 |
+----+---------------+------------+--------+-------------+-------------+---------------+
4 rows in set (0.00 sec)

Now, as far as I can tell what is happening is that when loading the schema the
first one (inetOrgPerson) is being overwritten by the second (document) without
a terminator, ending up with an "documenterson" which obviously doesn't exist.
Comment 1 Quanah Gibson-Mount 2017-04-04 15:05:05 UTC
--On Tuesday, April 04, 2017 7:30 AM +0000 thomas.fazekas@gmail.com wrote:

> Full_Name: Thomas Fazekas
> Version: 2.4.44
> OS: raspbian
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (213.181.38.213)

Hi Thomas,

The back-sql backend is clearly noted as being experimental in the man 
page.  Currently there is no active maintainer/developer for the backend, 
so no promises if/when this will be fixed. I would note that there have 
been a number of people who have working installations of back-sql, but I 
don't know the specifics of their setup.

Hope that helps.

--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 2 Quanah Gibson-Mount 2017-04-04 15:05:38 UTC
moved from Incoming to Software Bugs