[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Back-sql, debugging
> Hello,
>
> thanks for the answer, but I was executing slapd with -d 1 since I begun
> to work with.
>
> There is a little thing I do not understand, I got this output from
> slapd:
>
> backsql_get_db_conn(): first call -- reading schema map
> ==>backsql_load_schema_map()
> backsql_load_schema_map(): at_query 'SELECT
> name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return
> FROM ldap_attr_mappings WHERE oc_map_id=?'
> backsql_load_schema_map(): objectClass 'organizationalUnit':
> keytbl='orgunit' keycol='id'
> expect_return: add=0, del=0; attributes:
> backsql_load_schema_map(): autoadding 'objectClass' and 'ref' mappings
> backsql_load_schema_map(): error executing at_query:
> Return code: -1
> ==>backsql_free_db_conn()
>
>
> But where I do not understand is that the real sql executed in the db
> is:
>
> 00:00000:00019:2004/04/11 17:59:34.75 server TDS_LANG, spid 19: command
> text:
> set textsize 64512 use GAddress
> 00:00000:00019:2004/04/11 17:59:34.76 server TDS_LANG, spid 19: command
> text:
> BEGIN TRANSACTION
> 00:00000:00019:2004/04/11 17:59:34.77 server TDS_DYNP, spid 19: command
> text:
> create proc wlkz006000 as SELECT
> id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
> ldap_oc_mappings
> 00:00000:00019:2004/04/11 17:59:34.81 server TDS_LANG, spid 19: command
> text:
> IF @@TRANCOUNT > 0 ROLLBACK BEGIN TRANSACTION
>
The query is above:
SELECT
id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
ldap_oc_mappings
Do yu have ldap_oc_mappings? Does it have the requested columns?
This output looks really obscure to me. You may want to add a few
printf in back-sql before the queries are executed.
p.
> As you can see, ldap_attr_mappings is not fetched, so I don't know where
> the error is.
>
> I use freetds as an odbc driver with unixodbc.
>
> If you have any pointer that would help me a lot.
>
> Regards
>
> Goyman
>
> Pierangelo Masarati wrote:
>> run slapd with -d -1 and you get it all. Based on what version you're
>> using, you'll see more or less meaningful output. In HEAD and recent
>> 2.2 releases you get for sure the candidate search query with '?' and
>> a list of the parameters below. You don't get the queries to retrieve
>> every single value, though.
>>
>> back-sql debugging definitely needs work.
>>
>> p.
>>
>>
>>>Hello,
>>>
>>>I still try to debug my back-sql. I still have the same problem, but
>>> now I understand it at half.
>>>
>>>I did turn debugging on in odbc.ini, I got an sql statement like
>>> select id... from ldap_attr_mappings where oc_map_id = ?.
>>>
>>>I got the question mark ("?") in the log, and a call to
>>>bindParameter.c. But I don't have exact sql statements.
>>>
>>>My question is: do you know a way to ask openldap for all sql
>>> statement he send to odbc? So I would be able to execute them with
>>> isql and see the problem.
>>>
>>>Regards
>>>
>>>Goyman
>>>
>>>.::.:..: Celui qui appréhende le lendemain mourra idiot .:..:::
>>>
>>> goyman
>>
>>
>>
--
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it