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

back-sql with PostgreSQL on FreeBSD



Hello!

I have some problems configuring back-sql module to work with
PosgreSQL 7.4.2 Server on FreeBSD 5.2.1-RELEASE-p1.

It seems to me that I have correctly installed and configured unixODBC
2.2.8, ODBC Driver 7.2.5 for PostgreSQL server and DSN source, because
isql queries the test database just fine.

root hercules:/usr/local/etc$ isql PostgreSQL
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> SELECT * FROM authors_docs;
+------------+------------+
| pers_id    | doc_id     |
+------------+------------+
| 1          | 1          |
| 1          | 2          |
| 2          | 1          |
+------------+------------+
SQLRowCount returns 3
3 rows fetched
SQL>

The database that I'm using was populated with the following scripts:
	backsql_create.sql
	testdb_create.sql
	testdb_data.sql
	testdb_metadata.sql

That can be found within tarballs of OpenLDAP.

The most irritating part of this story is that when I start slapd it
just quits with core dump. 

root hercules:/usr/local/etc/openldap$ /usr/local/libexec/slapd -d 5
@(#) $OpenLDAP: slapd 2.2.6 (Mar 18 2004 20:24:29) $
...
...
...
********'documentAuthor'
name='documentAuthor',sel_expr='documentAuthor.dn' from='ldap_entries
AS
documentAuthor,documents,authors_docs,persons'join_where='documentAuth
or.keyval=persons.id AND documentAuthor.oc_map_id=1 AND
authors_docs.doc_id=documents.id AND
authors_docs.pers_id=persons.id',add_proc=''delete_proc=''
sel_expr_u=''
load_schema_map(): preconstructed query 'SELECT documentAuthor.dn AS
documentAuthor FROM ldap_entries
documentAuthor,documents,authors_docs,persons WHERE documents.id=? AND
documentAuthor.keyval=persons.id AND documentAuthor.oc_map_id=1 AND
authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id'
load_schema_map(): objectClass 'organization': keytbl='institutes'
keycol='id'
expect_return: add=0, del=0; attributes:
load_schema_map(): autoadding 'objectClass' and 'ref' mappings
********'o'
name='o',sel_expr='institutes.name'
from='institutes'join_where='',add_proc=''delete_proc=''
sel_expr_u=''
load_schema_map(): preconstructed query 'SELECT institutes.name AS o
FROM institutes WHERE institutes.id=?'
<==load_schema_map()
<==backsql_get_db_conn()
==>backsql_free_db_conn()
backsql_free_db_conn(): closing db connection
==>backsql_close_db_conn()
slapd in free(): error: chunk is already free
Abort trap (core dumped)

It seems that for some unknown reasons database connection is being
released earlier that it should be. I have tried it with both OpenLDAP
2.2.6 and OpenLDAP 2.1.27 release without any difference, they both
just dumps the core.

So the question is did someone has faced this problem already or knows
the resolution for it? Even thoughts to identify the problem are
welcomed.

Waiting for your help,
Andrey Nepomnyaschih