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

Newbie: odd question of ldapsearch :(



Hi all:
      when i try to start slapd(2.1.16+rh8.0) with back-sql(Mysql4.0.11) and do ldapsearch ,meeting a very very  strange question! 
when i enter" ldapsearch -x -b 'o=sql,c=RU' '(objectclass=*)'" ,
the debug info tell me that the server get "dn 'UR=C,LQS=O%'" !!!
      it is really amaming !,as a newbie,i am looking for your help !
      thanks very much!
 P.S
      i have listed the debug info of slapd -d 5
and Mysql-mysqld for reading ,i have made it as simple as i can .
       thanks for reading!!
************                            
slapd.conf
#######################################################################
# sql database definitions
#######################################################################
database	sql
suffix		"o=sql,c=RU"
rootdn		"cn=root,o=sql,c=RU"
rootpw		secret
dbname		openldap_data
dbuser		root
dbpasswd        mmjy
 
concat_pattern  CONCAT(?,?)
subtree_cond	"ldap_entries.dn=?"
at_query   
"SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc, param_order,expect_return FROM ldap_attr_mappingsm WHERE oc_map_id=?"

*************
slapd
*************************************************************
[root@Mamin root]# /usr/local/libexec/slapd -f /usr/local/etc/openldap/slapd.conf -d 5
@(#) $OpenLDAP: slapd 2.1.16 (Mon Jun  2 21:51:28 CST 2003) $
        root@Mamin:/usr/local/openldap-2.1.16/servers/slapd
... ...
==>backsql_initialize()
<==backsql_initialize()
... ...
<<< dnPrettyNormal: <cn=root,o=sql,c=RU>, <cn=root,o=sql,c=ru>
==>backsql_db_config()
......
==>backsql_db_config()
<==backsql_db_config(): concat_pattern="CONCAT(?,?)"
==>backsql_db_config()
<==backsql_db_config(): subtree_cond=ldap_entries.dn=?
==>backsql_db_config()
<==backsql_db_config(): 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=?
matching_rule_use_init
   ... ...
slapd startup: initiated.
==>backsql_db_open(): testing RDBMS connection

backsql_db_open(): setting 'ldap_entries.dn=?' as default
backsql_db_open(): setting 'SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM ldap_oc_mappings' by default
backsql_db_open(): setting 'INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)' by default
backsql_db_open(): setting 'DELETE FROM ldap_entries WHERE id=?' by default

backsql_open_db_conn(): connected, adding to tree
<==backsql_open_db_conn()
backsql_get_db_conn(): first call -- reading schema map
==>load_schema_map()
ldapinfo.dn_ru field exists in the schema

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=?'
load_schema_map(): objectClass 'inetOrgPerson': keytbl='persons' keycol='id'

load_schema_map(): autoadding 'objectClass' and 'ref' mappings
... ...
<==load_schema_map()
<==backsql_get_db_conn()
==>backsql_free_db_conn()
backsql_free_db_conn(): closing db connection

<==backsql_db_open(): test succeeded, schema map loaded
slapd starting
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[root@Mamin root]# ldapsearch -x -b 'o=sql,c=RU' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <o=sql,c=RU> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 0 Success

# numResponses: 1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

put_filter: "(objectclass=*)"
put_filter: simple
put_simple_filter: "objectclass=*"
ber_scanf fmt (m) ber:
connection_get(9)
connection_get(9): got connid=0

do_search
ber_scanf fmt ({miiiib) ber:
>>> dnPrettyNormal: <o=sql,c=RU>
=> ldap_bv2dn(o=sql,c=RU,0)
<= ldap_bv2dn(o=sql,c=RU,0)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(o=sql,c=RU,272)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(o=sql,c=ru,272)=0
<<< dnPrettyNormal: <o=sql,c=RU>, <o=sql,c=ru>
SRCH "o=sql,c=RU" 2 0    0 0 0
ber_scanf fmt (m) ber:
    filter: (objectClass=*)
ber_scanf fmt ({M}}) ber:
    attrs:
==>backsql_search(): base='o=sql,c=ru', filter='(objectClass=*)', scope=2, deref=0, attrsonly=0, attributes to load: all
==>backsql_get_db_conn()
backsql_open_db_conn(): connected, adding to tree
<==backsql_get_db_conn()
==>backsql_oc_get_candidates(): oc='organization'
<==backsql_process_filter()
<==backsql_srch_query()
************************
Constructed query: 
SELECT DISTINCT ldap_entries.id,institutes.id,'organization' AS objectClass,ldap_entries.dn AS dn FROM ldap_entries,institutes WHERE institutes.id=ldap_entries.keyval AND
ldap_entries.oc_map_id=? AND ldap_entries.dn LIKE ? AND NOT ('organization' IS NULL)
dn 'UR=C,LQS=O%'(***why?!***)
**************************
<==backsql_oc_get_candidates()
==>backsql_oc_get_candidates(): oc='document'
...
==>backsql_oc_get_candidates(): oc='inetOrgPerson'
...
do_unbind

<==backsql_unbind()
connection_resched: attempting closing conn=0 sd=9
connection_close: conn=0 sd=9
==>backsql_connection_destroy()
==>backsql_free_db_conn()
backsql_free_db_conn(): closing db connection

<==backsql_connection_destroy()
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
back-sql
******************************************************************
Version: '4.0.11a-gamma-debug'  socket: '/tmp/mysql.sock'  port: 3306
handle_connections_sockets: general: Waiting for connections.

dispatch_command: 
query: 
SELECT DISTINCT ldap_entries.id,institutes.id,'organization' AS objectClass,ldap_entries.dn AS dn FROM ldap_entries,institutes WHERE institutes.id=ldap_entries.keyval AND ldap_entries.oc_map_id=3 AND ldap_entries.dn LIKE 'UR=C,LQS=O%' AND NOT ('organization' IS NULL)
openfrm: info: i_count: 0  i_parts: 0  index: 3  n_length: 32  int_length: 0

WHERE:(after remove) ((institutes.id = ldap_entries.keyval) and (ldap_entries.oc_map_id = 3) and (ldap_entries.dn like 'UR=C,LQS=O%'))
make_join_select: info: Found impossible WHERE condition
... ...

_mi_prefix_search: info: key: 'UR=C,LQS=O'

_mi_prefix_search: info: key: 'UR=C,LQS=O?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????'

mi_records_in_range: info: records: 0
Used quick_range on key: 2 (other_keys: 0):
UR=C,LQS=O <= X <= UR=C,LQS=O?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
... ...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

______________________________________

===================================================================
¶©·Ç³£Ð¦»°³é´ó½± ²ÊÆÁÊÖ»úÒ»ÌìÒ»²¿! (http://sms.sina.com.cn/act/fcxhhd.html)