committin what I have so that someone else might be able to work it.
SRCS = init.c tools.c config.c \
add.c bind.c compare.c delete.c modify.c modrdn.c search.c \
extended.c passwd.c referral.c \
- attr.c index.c key.c dbcache.c \
+ attr.c index.c key.c dbcache.c filterindex.c \
dn2entry.c dn2id.c error.c id2entry.c idl.c nextid.c
OBJS = init.lo tools.lo config.lo \
add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \
extended.lo passwd.lo referral.lo \
- attr.lo index.lo key.lo dbcache.lo \
+ attr.lo index.lo key.lo dbcache.lo filterindex.lo \
dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo nextid.lo
LDAP_INCDIR= ../../../include
#define BDB_SUFFIX ".bdb"
#define BDB_NEXTID 0
-#define BDB_DN2ID 1
-#define BDB_ID2ENTRY 2
+#define BDB_ID2ENTRY 1
+#define BDB_DN2ID 2
#define BDB_NDB 3
#define BDB_INDICES 128
goto return_results;
}
+ /* delete indices for old attributes */
+ rc = bdb_index_entry_del( be, ltid, e, e->e_attrs );
+ if ( rc != LDAP_SUCCESS ) {
+ switch( rc ) {
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto retry;
+ default:
+ rc = LDAP_OTHER;
+ }
+ Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n",
+ 0, 0, 0 );
+ text = "entry index delete failed";
+ goto return_results;
+ }
+
/* delete from id2entry */
if ( bdb_id2entry_delete( be, ltid, e->e_id ) != 0 ) {
switch( rc ) {
DB *db = bdb->bi_dn2id->bdi_db;
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_add( \"%s\", 0x%08lx )\n",
- dn, id, 0 );
+ dn, (long) id, 0 );
assert( id != NOID );
DBTzero( &key );
Debug( LDAP_DEBUG_TRACE,
"<= bdb_dn2id_matched: id=0x%08lx: %s %s\n",
- *id, *matchedDN == NULL ? "entry" : "matched", dn );
+ (long) *id, *matchedDN == NULL ? "entry" : "matched", dn );
break;
} else {
Debug( LDAP_DEBUG_TRACE,
"<= bdb_dn2idl: get failed: %s (%d)\n",
db_strerror( rc ), rc, 0 );
+
} else {
Debug( LDAP_DEBUG_TRACE,
"<= bdb_dn2idl: id=%ld first=%ld last=%ld\n",
- ids[0], BDB_IDL_FIRST( ids ), BDB_IDL_LAST( ids ) );
+ (long) ids[0],
+ (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) );
}
ch_free( key.data );
return rc;
}
-
break;
case LDAP_FILTER_NOT: {
- ID tmp[BDB_IDL_SIZE];
+ ID tmp[BDB_IDL_UM_SIZE];
Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
rc = bdb_filter_candidates( be, range, f->f_not, tmp );
Debug( LDAP_DEBUG_FILTER,
"<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
- ids[0], ids[1],
- BDB_IDL_IS_RANGE( ids ) ? ids[2] : ids[ids[0]] );
+ (long) ids[0],
+ (long) BDB_IDL_FIRST( ids ),
+ (long) BDB_IDL_LAST( ids ) );
return 0;
}
}
for ( f = flist; f != NULL; f = f->f_next ) {
- ID tmp[BDB_IDL_SIZE];
- ID result[BDB_IDL_SIZE];
+ ID tmp[BDB_IDL_UM_SIZE];
+ ID result[BDB_IDL_UM_SIZE];
rc = bdb_filter_candidates( be, range, f, tmp );
if ( rc != 0 ) {
Debug( LDAP_DEBUG_FILTER,
"<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
- ids[0], BDB_IDL_FIRST(ids), BDB_IDL_LAST(ids) );
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
return 0;
}
Debug(LDAP_DEBUG_TRACE,
"<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
- ids[0], BDB_IDL_FIRST(ids), BDB_IDL_LAST(ids) );
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
done:
ber_bvfree( prefix );
}
for ( i= 0; keys[i] != NULL; i++ ) {
- ID save[BDB_IDL_SIZE];
- ID tmp[BDB_IDL_SIZE];
+ ID save[BDB_IDL_UM_SIZE];
+ ID tmp[BDB_IDL_UM_SIZE];
rc = bdb_key_read( be, db, keys[i], tmp );
ber_bvecfree( keys );
Debug( LDAP_DEBUG_TRACE,
- "<= bdb_equality_candidates %ld\n",
- ids[0], BDB_IDL_FIRST(ids), BDB_IDL_LAST(ids) );
+ "<= bdb_equality_candidates id=%ld, first=%ld, last=%ld\n",
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
return( idl );
}
ber_bvecfree( keys );
- Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
- ids[0], BDB_IDL_FIRST(ids), BDB_IDL_LAST(ids) );
+ Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld, first=%ld, last=%ld\n",
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
return( idl );
}
ber_bvecfree( keys );
- Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates %ld\n",
- ids[0], BDB_IDL_FIRST(ids), BDB_IDL_LAST(ids) );
+ Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates %ld, first=%ld, last=%ld\n",
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
return( idl );
}
static void idl_check( ID *ids )
{
if( BDB_IDL_IS_RANGE( ids ) ) {
- assert( ids[1] <= ids[2] );
+ assert( BDB_IDL_RANGE_FIRST(ids) <= BDB_IDL_RANGE_LAST(ids) );
} else {
ID i;
for( i=1; i < ids[0]; i++ ) {
{
if( BDB_IDL_IS_RANGE( ids ) ) {
Debug( LDAP_DEBUG_ANY,
- "IDL: range %ld - %ld\n",
- (long) ids[1], (long) idl[2], 0 );
+ "IDL: range ( %ld - %ld )\n",
+ (long) BDB_IDL_RANGE_FIRST( ids ),
+ (long) BDB_IDL_RANGE_LAST( ids ) );
} else {
ID i;
if( i % 16 == 1 ) {
Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 );
}
- Debug( LDAP_DEBUG_ANY, " %02lx", ids[i], 0, 0 );
+ Debug( LDAP_DEBUG_ANY, " %02lx", (long) ids[i], 0, 0 );
}
Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 );
unsigned x = bdb_idl_search( ids, id );
#if IDL_DEBUG > 1
- Debug( LDAP_DEBUG_ANY, "insert: %04lx at %d\n", id, x, 0 );
+ Debug( LDAP_DEBUG_ANY, "insert: %04lx at %d\n", (long) id, x, 0 );
idl_dump( ids );
#elif IDL_DEBUG > 0
idl_check( ids );
unsigned x = bdb_idl_search( ids, id );
#if IDL_DEBUG > 1
- Debug( LDAP_DEBUG_ANY, "delete: %04lx at %d\n", id, x, 0 );
+ Debug( LDAP_DEBUG_ANY, "delete: %04lx at %d\n", (long) id, x, 0 );
idl_dump( ids );
#elif IDL_DEBUG > 0
idl_check( ids );
DBTzero( &data );
data.data = ids;
- data.ulen = BDB_IDL_SIZE * sizeof( ID );
+ data.ulen = BDB_IDL_UM_SIZEOF;
data.flags = DB_DBT_USERMEM;
/* fetch it */
rc = db->get( db, tid, key, &data, 0 );
+ if( rc == DB_NOTFOUND ) {
+ return rc;
+
+ } else if( rc != 0 ) {
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "get failed: %s (%d)\n",
+ db_strerror(rc), rc, 0 );
+ return rc;
+
+ } else if ( data.size == 0 || data.size % sizeof( ID ) ) {
+ /* size not multiple of ID size */
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "odd size: expected %ld multiple, got %ld\n",
+ (long) sizeof( ID ), (long) data.size, 0 );
+ return -1;
+
+ } else if ( data.size != BDB_IDL_SIZEOF(ids) ) {
+ /* size mismatch */
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "get size mismatch: expected %ld, got %ld\n",
+ (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
+ return -1;
+ }
+
return rc;
}
assert( id != NOID );
data.data = ids;
- data.ulen = sizeof( ids );
+ data.ulen = sizeof ids;
data.flags = DB_DBT_USERMEM;
/* fetch the key for read/modify/write */
data.size = 2 * sizeof( ID );
} else if ( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_insert_key: get failed: %s (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
+ "get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
return rc;
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
/* size not multiple of ID size */
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
+ "odd size: expected %ld multiple, got %ld\n",
(long) sizeof( ID ), (long) data.size, 0 );
return -1;
+ } else if ( data.size != BDB_IDL_SIZEOF(ids) ) {
+ /* size mismatch */
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
+ "get size mismatch: expected %ld, got %ld\n",
+ (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
+ return -1;
+
} else if ( BDB_IDL_IS_RANGE(ids) ) {
if( id < ids[1] ) {
ids[1] = id;
return 0;
}
- } else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
- /* size mismatch */
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_insert_key: get size mismatch: expected %ld, got %ld\n",
- (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
- return -1;
-
} else {
rc = idl_insert( ids, id );
if( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_insert_key: idl_insert failed (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
+ "idl_insert failed (%d)\n",
rc, 0, 0 );
return rc;
}
- if( BDB_IDL_IS_RANGE( ids ) ) {
- data.size = BDB_IDL_RANGE_SIZE;
- } else {
- data.size = (ids[0]+1) * sizeof( ID );
- }
+ data.size = BDB_IDL_SIZEOF( ids );
}
/* store the key */
rc = db->put( db, tid, key, &data, 0 );
if( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_insert_key: get failed: %s (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
+ "put failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
}
return rc;
rc = db->get( db, tid, key, &data, DB_RMW );
if ( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_delete_key: get failed: %s (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
+ "get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
return rc;
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
/* size not multiple of ID size */
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_delete_key: odd size: expected %ld multiple, got %ld\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
+ "odd size: expected %ld multiple, got %ld\n",
(long) sizeof( ID ), (long) data.size, 0 );
return -1;
} else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) {
/* size mismatch */
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_delete_key: get size mismatch: expected %ld, got %ld\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
+ "get size mismatch: expected %ld, got %ld\n",
(long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
return -1;
rc = idl_delete( ids, id );
if( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_delete_key: idl_delete failed (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
+ "idl_delete failed (%d)\n",
rc, 0, 0 );
return rc;
}
/* delete the key */
rc = db->del( db, tid, key, 0 );
if( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_idl_delete_key: delete failed: %s (%d)\n",
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
+ "delete failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
}
return rc;
ids[0] = 0;
while( ida != NOID && idb != NOID ) {
- if( ++ids[0] > BDB_IDL_MAX ) {
+ if( ++ids[0] > BDB_IDL_UM_MAX ) {
ids[0] = NOID;
ids[2] = IDL_MAX( BDB_IDL_LAST(a), BDB_IDL_LAST(b) );
break;
#include "slap.h"
- /* larger IDL sizes - likely should be even bigger */
-#define BDB_IDL_DB_SIZE (1<<16) /* 64K IDL on disk */
-#define BDB_IDL_SIZE (1<<17) /* 128K IDL in memory */
+/* IDL sizes - likely should be even bigger
+ * limiting factors: sizeof(ID), thread stack size
+ */
+#define BDB_IDL_DB_SIZE (1<<16) /* 32K IDL on disk */
+#define BDB_IDL_UM_SIZE (1<<17) /* 64K IDL in memory */
+#define BDB_IDL_UM_SIZEOF (BDB_IDL_UM_SIZE * sizeof(ID))
#define BDB_IDL_DB_MAX (BDB_IDL_DB_SIZE-32)
/* #define BDB_IDL_DB_ALLOC (BDB_IDL_DB_SIZE * sizeof(ID)) */
-#define BDB_IDL_MAX (BDB_IDL_DB_SIZE-32)
-/* #define BDB_IDL_DB_ALLOC (BDB_IDL_DB_SIZE * sizeof(ID)) */
+#define BDB_IDL_UM_MAX (BDB_IDL_UM_SIZE-32)
+/* #define BDB_IDL_UM_ALLOC (BDB_IDL_UM_SIZE * sizeof(ID)) */
#define BDB_IDL_IS_RANGE(ids) ((ids)[0] == NOID)
-#define BDB_IDL_RANGE_SIZE (3 * sizeof(ID))
-#define BDB_IDL_SIZEOF(ids) ( BDB_IDL_IS_RANGE(ids) \
- ? BDB_IDL_RANGE_SIZE : ((ids)[0]+1) * sizeof(ID) )
+#define BDB_IDL_RANGE_SIZE (3)
+#define BDB_IDL_RANGE_SIZEOF (BDB_IDL_RANGE_SIZE * sizeof(ID))
+#define BDB_IDL_SIZEOF(ids) (BDB_IDL_IS_RANGE(ids) \
+ ? BDB_IDL_RANGE_SIZE : ((ids)[0]+1) * sizeof(ID))
+
+#define BDB_IDL_RANGE_FIRST(ids) ((ids)[1])
+#define BDB_IDL_RANGE_LAST(ids) ((ids)[2])
#define BDB_IDL_RANGE( ids, f, l ) \
do { \
(ids)[0] = 0; \
(ids)[1] = 0; \
(ids)[2] = 0; \
- } while(0);
+ } while(0)
#define BDB_IDL_IS_ZERO(ids) ( (ids)[0] == 0 )
#define BDB_IDL_IS_ALL( range, ids ) ( (ids)[0] == NOID \
&& (ids)[1] <= (range)[1] && (range)[2] <= (ids)[2] )
-#define BDB_IDL_CPY( dst, src ) (memcpy( dst, src, BDB_IDL_SIZEOF( src ) ))
+#define BDB_IDL_CPY( dst, src ) (AC_MEMCPY( dst, src, BDB_IDL_SIZEOF( src ) ))
#define BDB_IDL_ID( bdb, ids, id ) BDB_IDL_RANGE( ids, id, ((bdb)->bi_lastid) )
#define BDB_IDL_ALL( bdb, ids ) BDB_IDL_RANGE( ids, 1, ((bdb)->bi_lastid) )
Backend *be,
AttributeDescription *desc,
int ftype,
- char **dbnamep,
+ DB **dbp,
slap_mask_t *maskp,
struct berval **prefixp )
{
+ int rc;
slap_mask_t mask;
+ DB *db;
char *dbname;
char *atname;
return LDAP_INAPPROPRIATE_MATCHING;
}
+ rc = bdb_db_cache( be, dbname, &db );
+
+ if( rc != LDAP_SUCCESS ) {
+ return rc;
+ }
+
switch(ftype) {
case LDAP_FILTER_PRESENT:
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
return LDAP_INAPPROPRIATE_MATCHING;
done:
- *dbnamep = dbname;
+ *dbp = db;
*prefixp = ber_bvstrdup( atname );
*maskp = mask;
return LDAP_SUCCESS;
#ifdef NEW_LOGGING
LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: %s (%s)%ld\n",
+ "index_entry: %s (%s) %ld\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_dn, e->e_id ));
+ e->e_dn, (long) e->e_id ));
#else
Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_id, e->e_dn );
+ (long) e->e_id, e->e_dn );
#endif
/* add each attribute to the indexes */
Debug( LDAP_DEBUG_TRACE,
"<= index_entry_%s( %ld, \"%s\" ) success\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_id, e->e_dn );
+ (long) e->e_id, e->e_dn );
#endif
return rc;
}
#ifdef NEW_LOGGING
LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: success\n" ));
+ "index_entry: success\n" ));
#else
Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_id, e->e_dn );
+ (long) e->e_id, e->e_dn );
#endif
return LDAP_SUCCESS;
int flags;
} bdbi_databases[] = {
{ "nextid" BDB_SUFFIX, "nextid", DB_BTREE, 0 },
- { "dn2entry" BDB_SUFFIX, "dn2entry", DB_BTREE, 0 },
{ "id2entry" BDB_SUFFIX, "id2entry", DB_BTREE, 0 },
+ { "dn2id" BDB_SUFFIX, "dn2id", DB_BTREE, 0 },
{ NULL, NULL, 0, 0 }
};
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "bdb_key_read: %ld candidates\n", BDB_IDL_N(ids) );
+ "bdb_key_read: %ld candidates\n", (long) BDB_IDL_N(ids) ));
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read %ld candidates\n",
- BDB_IDL_N(ids), 0, 0 );
+ (long) BDB_IDL_N(ids), 0, 0 );
#endif
}
#ifdef NEW_LOGGING
LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
"key_change: %s ID %lx\n",
- op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id ));
+ op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id ));
#else
Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
- np, np->e_id, 0 );
+ np, (long) np->e_id, 0 );
/* check newSuperior for "children" acl */
if ( !access_allowed( be, conn, op, np, children, NULL, ACL_WRITE ) ) {
*/
int bdb_filter_candidates(
Backend *be,
- ID *range,
Filter *f,
ID *ids );
Backend *be,
AttributeDescription *desc,
int ftype,
- char **dbname,
+ DB **db,
slap_mask_t *mask,
struct berval **prefix ));
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
- op->o_tag, dn, matched_dn );
+ (long) op->o_tag, dn, matched_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
- op->o_tag, dn, e->e_dn );
+ (long) op->o_tag, dn, e->e_dn );
if( refs != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
const char *text = NULL;
time_t stoptime;
ID id, cursor;
- ID candidates[BDB_IDL_SIZE];
+ ID candidates[BDB_IDL_UM_SIZE];
Entry *e = NULL;
struct berval **v2refs = NULL;
Entry *matched = NULL;
/* only complain for non-range IDLs */
Debug( LDAP_DEBUG_TRACE,
"bdb_search: candidate %ld not found\n",
- id, 0, 0 );
+ (long) id, 0, 0 );
}
goto loop_continue;
} else {
Debug( LDAP_DEBUG_TRACE,
"bdb_search: %ld scope not okay\n",
- id, 0, 0 );
+ (long) id, 0, 0 );
}
} else {
Debug( LDAP_DEBUG_TRACE,
"bdb_search: %ld does match filter\n",
- id, 0, 0 );
+ (long) id, 0, 0 );
}
loop_continue:
#ifdef BDB_FILTER_INDICES
- {
- ID range[3];
- BDB_IDL_ID( bdb, range, e->e_id );
- rc = bdb_filter_candidates( be, range, &f, ids );
- }
+ rc = bdb_filter_candidates( be, &f, ids );
#else
BDB_IDL_ID( bdb, ids, e->e_id );
rc = 0;
#endif
Debug(LDAP_DEBUG_TRACE,
- "search_candidates: id=%ld first=%ld last=%ld\n",
- ids[0], ids[1],
- BDB_IDL_IS_RANGE( ids ) ? ids[2] : ids[ids[0]] );
+ "bdb_search_candidates: id=%ld first=%ld last=%ld\n",
+ (long) ids[0],
+ (long) BDB_IDL_FIRST(ids),
+ (long) BDB_IDL_LAST(ids) );
return rc;
}
assert( slapMode & SLAP_TOOL_MODE );
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
- e->e_id, e->e_dn, 0 );
+ (long) e->e_id, e->e_dn, 0 );
rc = txn_begin( bdb->bi_dbenv, NULL, &tid, 0 );
if( rc != 0 ) {
*/
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n",
- id, e->e_dn, 0 );
+ (long) id, e->e_dn, 0 );
rc = bdb_index_entry_add( be, tid, e, e->e_attrs );