/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#endif
{
buf[0] = DN_SUBTREE_PREFIX;
- rc = db->del( db, txn, &key, 0 );
+ rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id );
if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
int
bdb_dn2idl(
Operation *op,
+ u_int32_t locker,
Entry *e,
ID *ids,
ID *stack )
AC_MEMCPY( &((char *)key.data)[1], e->e_nname.bv_val, key.size - 1 );
BDB_IDL_ZERO( ids );
- rc = bdb_idl_fetch_key( op->o_bd, db, NULL, &key, ids, NULL, 0 );
+ rc = bdb_idl_fetch_key( op->o_bd, db, locker, &key, ids, NULL, 0 );
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
struct dn2id_cookie {
struct bdb_info *bdb;
Operation *op;
+ u_int32_t locker;
EntryInfo *ei;
ID *ids;
ID *tmp;
if ( !BDB_IDL_IS_RANGE( cx->tmp ) && cx->tmp[0] > 3 )
bdb_idl_sort( cx->tmp, cx->buf );
- if ( cx->bdb->bi_idl_cache_max_size ) {
+ if ( cx->bdb->bi_idl_cache_max_size && !BDB_IDL_IS_ZERO( cx->tmp )) {
char *ptr = ((char *)&cx->id)-1;
cx->key.data = ptr;
cx->key.size = sizeof(ID)+1;
int
hdb_dn2idl(
Operation *op,
+ u_int32_t locker,
Entry *e,
ID *ids,
ID *stack )
cx.tmp = stack;
cx.buf = stack + BDB_IDL_UM_SIZE;
cx.op = op;
+ cx.locker = locker;
cx.need_sort = 0;
cx.depth = 0;
cx.key.size = sizeof(ID)+1;
*ptr = cx.prefix;
cx.id = e->e_id;
- bdb_idl_cache_put( cx.bdb, cx.db, &cx.key, cx.ids, cx.rc );
+ if ( cx.bdb->bi_idl_cache_max_size )
+ bdb_idl_cache_put( cx.bdb, cx.db, &cx.key, cx.ids, cx.rc );
}
if ( cx.rc == DB_NOTFOUND )