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

Re: New submission of OpenLDAP/PostgreSQL patches (ITS#1458)

Hello Gilles,

thank you for your contribution.
I will try to review these things as soon as I can (unfortunately I'm
extremely short on time these days). Meanwhile, I have a couple of things to
ask of you.
I understand that you modified back-sql coming with release tarball
(2.0.18), but there are significant improvements applied to -devel branch,
that were not included into release. Could you please review, if some of
your improvements are already addressed there, and synchronize your patches
with development version? This will greatly simplify my job, and increase
chances to release these things quick...

WBW, Dmitry

----- Original Message -----
From: <gdarold@samse.fr>
To: <openldap-its@OpenLDAP.org>
Sent: Wednesday, November 21, 2001 12:58 PM
Subject: New submission of OpenLDAP/PostgreSQL patches (ITS#1458)

> Full_Name: Gilles DAROLD
> Version: 2.0.18
> OS: Linux (RH 6.2)
> URL: http://www.samse.fr/GPL/ldap_pg/ldap_pg.tar.gz
> Submission from: (NULL) (
> OpenLDAP need five small patches to have OpenLDAP working with PostgreSQL.
> 1) servers/slapd/back-sql/search.c
> The first patch is used to cast the objectClass statement into search
> I've defined a new slapd.conf option named 'oc_cast' to be portable to
> RDBMS that could need this feature. This option allow a call to a cast
> function.
> For PostgreSQL it must be set to 'text' that will result as the following
> for example:
> SELECT DISTINCT ldap_entries.id,documents.id, text('document') AS
>                 ldap_entries.dn AS dn FROM ldap_entries,documents
>    WHERE documents.id=ldap_entries.keyval AND ldap_entries.oc_map_id=2
>    AND ldap_entries.parent=1 AND NOT ('document' IS NULL)
> In the slapd.conf it is set as:
> oc_cast         "text"
> A more portable way should be to implement a pattern replacement to allow
> syntax. For example the followings setting are both possible with
> oc_cast         "text(?)"
> oc_cast         "?::text"
> My knowledge in C++ is not enougth to code that, if someone is easy with
> it should be a good contribution to portability over all RDBMS backend.
> 2) servers/slapd/back-sql/entry-id.c
> The second patch is used to preserve the alias name of a column in the SQL
> queries.
> This feature is not yet implemented into the ODBC driver for PostgreSQL
> probably
> some other RDBMS driver. Hiroshi Inoue that handle the PostgreSQL ODBC
> said
> that it will be fixed into the next release but other SQL backend could
> this
> patch too.
> For example the following SQL query:
>         SELECT persons.name AS sn FROM persons WHERE persons.id=2
> may return 'sn' as column named that it was not done. So the patch force
> colname
> to be at->name intstead of row.col_names[i].
> 3) servers/slapd/back-sql/modify.c
> The third patch concerne the update of the internal unique id (new_keyval)
> is
> expected to be modified by the 'create_proc' procedure call as a parameter
> passed
> by reference to the SQL procedure used to create the new entry.
> With PostgreSQL you can't pass a parameter to SQL function by reference
> with
> Oracle (INOUT param), it simply receive parameters and return a result. So
> fix
> this problem that can also be found in other SQL backend I have added an
> configuration option called 'id_notbyref' that activate the update of the
> new_keyval
> by reading the value return as result of the SQL procedure.
> Usage in slapd.conf is:
>         id_notbyref     "1"
> 4) server/slapd/back-sql.h and servers/slapd/back-sql/config.c
> The two other patches concerne the definition and the retrieving of the
two new
> configuration options that may be used into the slapd.conf to have
> working.
> --------------------------------------------------------------------------
> I think that these patches should improve support to many other SQL
> without any change to the current supported SQL backend and any change
into the
> running slapd.conf.
> There's still a problem when you use a openLDAP SQL backend as slave
> that
> seems to affect all RDBMS: back-sql doesn't support the ManageDsaIT...
> In the uploading URL I have made a tarball including:
> - all these patches,
> - the HOWTO explaining the implementation of PostgreSQL as OpenLDAP
>   (can also be usefull for other RDBMS)
> - the rdbms_depend/postgres/directory with all SQL test scripts and the
> files
> - and some LDIFF file to test the installation as explained in the HOWTO
> Let me know if you need more information.
> I will add a live example of the back-sql implementation into the HOWTO
> Regards
> --------------------------------------------------------------------------
> Copyright 2001, Gilles DAROLD, All rights reserved.
> These patches, associated files and documentation
> are not subject to any license of Gilles DAROLD.
> This is free software; you can redistribute and use
> it under the same terms as OpenLDAP itself.