ITS#7604 fix modrdn, base-scope search

This commit is contained in:
Howard Chu 2013-05-24 11:08:25 -07:00
parent 1748f03041
commit a3de7c29ae
6 changed files with 7 additions and 4 deletions

View File

@ -338,7 +338,7 @@ txnReturn:
op->ora_e->e_id = eid;
/* dn2id index */
rs->sr_err = mdb_dn2id_add( op, mcd, mcd, pid, 1, op->ora_e );
rs->sr_err = mdb_dn2id_add( op, mcd, mcd, pid, 1, 1, op->ora_e );
mdb_cursor_close( mcd );
if ( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,

View File

@ -86,6 +86,7 @@ mdb_dn2id_add(
MDB_cursor *mcd,
ID pid,
ID nsubs,
int upsub,
Entry *e )
{
struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private;
@ -156,7 +157,7 @@ mdb_dn2id_add(
op->o_tmpfree( d, op->o_tmpmemctx );
/* Add our subtree count to all superiors */
if ( rc == 0 && nsubs && pid ) {
if ( rc == 0 && upsub && pid ) {
ID subs;
nid = pid;
do {

View File

@ -492,7 +492,7 @@ txnReturn:
/* add new DN */
rs->sr_err = mdb_dn2id_add( op, mc, mc, np ? np->e_id : p->e_id,
np ? nsubs : 0, &dummy );
nsubs, np != NULL, &dummy );
if ( rs->sr_err != 0 ) {
Debug(LDAP_DEBUG_TRACE,
"<=- " LDAP_XSTRING(mdb_modrdn)

View File

@ -82,6 +82,7 @@ int mdb_dn2id_add(
MDB_cursor *mcd,
ID pid,
ID nsubs,
int upsub,
Entry *e );
int mdb_dn2id_delete(

View File

@ -538,6 +538,7 @@ dn2entry_retry:
/* select candidates */
if ( op->oq_search.rs_scope == LDAP_SCOPE_BASE ) {
rs->sr_err = base_candidate( op->o_bd, base, candidates );
scopes[0].mid = 0;
ncand = 1;
} else {
if ( op->ors_scope == LDAP_SCOPE_ONELEVEL ) {

View File

@ -471,7 +471,7 @@ static int mdb_tool_next_id(
"=> mdb_tool_next_id: %s\n", text->bv_val, 0, 0 );
return rc;
}
rc = mdb_dn2id_add( op, mcp, mcd, pid, 1, e );
rc = mdb_dn2id_add( op, mcp, mcd, pid, 1, 1, e );
if ( rc ) {
snprintf( text->bv_val, text->bv_len,
"dn2id_add failed: %s (%d)",