DBTzero( &key );
key.size = e->e_nname.bv_len + 2;
+ key.ulen = key.size;
+ key.flags = DB_DBT_USERMEM;
buf = ch_malloc( key.size );
key.data = buf;
buf[0] = DN_BASE_PREFIX;
dnParent( &ptr, &pdn );
key.size = pdn.bv_len + 2;
+ key.ulen = key.size;
pdn.bv_val[-1] = DN_ONE_PREFIX;
key.data = pdn.bv_val-1;
ptr = pdn;
dnParent( &ptr, &pdn );
key.size = pdn.bv_len + 2;
+ key.ulen = key.size;
key.data = pdn.bv_val - 1;
ptr = pdn;
}
if( !be_issuffix( be, &ptr )) {
buf[0] = DN_SUBTREE_PREFIX;
- rc = bdb_idl_delete_key( be, db, txn, &key, e->e_id );
+ rc = db->del( db, txn, &key, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG (( "db2id", LDAP_LEVEL_ERR,
dnParent( &ptr, &pdn );
key.size = pdn.bv_len + 2;
+ key.ulen = key.size;
pdn.bv_val[-1] = DN_ONE_PREFIX;
key.data = pdn.bv_val - 1;
ptr = pdn;
dnParent( &ptr, &pdn );
key.size = pdn.bv_len + 2;
+ key.ulen = key.size;
key.data = pdn.bv_val - 1;
ptr = pdn;
}
DBTzero( &key );
key.size = dn->bv_len + 2;
+ key.ulen = key.size;
+ key.flags = DB_DBT_USERMEM;
key.data = ch_malloc( key.size );
((char *)key.data)[0] = prefix;
AC_MEMCPY( &((char *)key.data)[1], dn->bv_val, key.size - 1 );
if ( rc == 0 ) {
if ( tmp != 0 ) {
/* Not a range, just delete it */
- data.data = &id;
- rc = cursor->c_get( cursor, key, &data,
- DB_GET_BOTH | DB_RMW );
+ if (tmp != id) {
+ /* position to correct item */
+ tmp = id;
+ rc = cursor->c_get( cursor, key, &data,
+ DB_GET_BOTH | DB_RMW );
+ }
if ( rc == 0 ) {
rc = cursor->c_del( cursor, 0 );
if ( rc != 0 ) {
DBTzero( &key );
bv2DBT(k,&key);
+ key.ulen = key.size;
+ key.flags = DB_DBT_USERMEM;
rc = bdb_idl_fetch_key( be, db, txn, &key, ids );
DBTzero( &key );
bv2DBT(k,&key);
+ key.ulen = key.size;
+ key.flags = DB_DBT_USERMEM;
if (op == SLAP_INDEX_ADD_OP) {
/* Add values */