memcpy( ptr, &pid, sizeof( ID ));
d->nrdnlen[0] ^= 0x80;
- if (slapMode & SLAP_TOOL_MODE)
+ if ((slapMode & SLAP_TOOL_MODE) || (e->e_id == mdb->mi_nextid))
flag |= MDB_APPEND;
rc = mdb_cursor_put( mcd, &key, &data, flag );
}
int
mdb_idl_insert_keys(
+ BackendDB *be,
MDB_cursor *cursor,
struct berval *keys,
ID id )
{
+ struct mdb_info *mdb = be->be_private;
MDB_val key, data;
ID lo, hi, *i;
char *err;
}
} else {
/* There's room, just store it */
- if ( slapMode & SLAP_TOOL_QUICK )
- flag |= MDB_APPEND;
+ if (id == mdb->mi_nextid)
+ flag |= MDB_APPENDDUP;
goto put1;
}
} else {
}
}
} else if ( rc == MDB_NOTFOUND ) {
- flag &= ~MDB_APPEND;
+ flag &= ~MDB_APPENDDUP;
put1: data.mv_data = &id;
data.mv_size = sizeof(ID);
rc = mdb_cursor_put( cursor, &key, &data, flag );
int
mdb_idl_delete_keys(
+ BackendDB *be,
MDB_cursor *cursor,
struct berval *keys,
ID id )
keyfunc = mdb_idl_delete_keys;
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
- rc = keyfunc( mc, presence_key, id );
+ rc = keyfunc( op->o_bd, mc, presence_key, id );
if( rc ) {
err = "presence";
goto done;
atname, vals, &keys, op->o_tmpmemctx );
if( rc == LDAP_SUCCESS && keys != NULL ) {
- rc = keyfunc( mc, keys, id );
+ rc = keyfunc( op->o_bd, mc, keys, id );
ber_bvarray_free_x( keys, op->o_tmpmemctx );
if ( rc ) {
err = "equality";
atname, vals, &keys, op->o_tmpmemctx );
if( rc == LDAP_SUCCESS && keys != NULL ) {
- rc = keyfunc( mc, keys, id );
+ rc = keyfunc( op->o_bd, mc, keys, id );
ber_bvarray_free_x( keys, op->o_tmpmemctx );
if ( rc ) {
err = "approx";
atname, vals, &keys, op->o_tmpmemctx );
if( rc == LDAP_SUCCESS && keys != NULL ) {
- rc = keyfunc( mc, keys, id );
+ rc = keyfunc( op->o_bd, mc, keys, id );
ber_bvarray_free_x( keys, op->o_tmpmemctx );
if( rc ) {
err = "substr";