#if BDB_INDEX
/* attribute indexes */
- if ( index_entry_add( be, e, e->e_attrs ) != LDAP_SUCCESS ) {
+ if ( bdb_index_entry_add( be, ltid, e, e->e_attrs ) != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n",
0, 0, 0 );
switch( rc ) {
LDAP_BEGIN_DECL
-#define BBD_INDEX 1
+/* #define BDB_INDEX 1 */
+/* #define BDB_REINDEX 1 */
/* #define BDB_FILTER_INDICES 1 */
#define BDB_CONFIG_INDICES 1
bi->bi_tool_entry_next = bdb_tool_entry_next;
bi->bi_tool_entry_get = bdb_tool_entry_get;
bi->bi_tool_entry_put = bdb_tool_entry_put;
+#if BDB_REINDEX
+ bi->bi_tool_entry_reindex = bdb_tool_entry_reindex;
+#else
bi->bi_tool_entry_reindex = 0;
+#endif
bi->bi_tool_sync = 0;
bi->bi_connection_init = 0;
#if BDB_INDEX
/* delete indices for old attributes */
- rc = index_entry_del( be, tid, e, save_attrs);
+ rc = bdb_index_entry_del( be, tid, e, save_attrs);
/* add indices for new attributes */
- rc = index_entry_add( be, tid, e, e->e_attrs);
+ rc = bdb_index_entry_add( be, tid, e, e->e_attrs);
#endif
attrs_free( save_attrs );
return e->e_id;
}
-#if BDB_INDEX
+#if BDB_REINDEX
int bdb_tool_entry_reindex(
BackendDB *be,
ID id )
{
- struct bdb_dbinfo *bdi = (struct bdb_dbinfo *) be->be_private;
+ struct bdb_info *bi = (struct bdb_info *) be->be_private;
int rc;
Entry *e;
- DB_TXN *tid;
+ DB_TXN *tid = NULL;
Debug( LDAP_DEBUG_ARGS, "=> bdb_tool_entry_reindex( %ld )\n",
(long) id, 0, 0 );
- rc = txn_begin( bdi->bdi_db_env, NULL, &tid, 0 );
+#if 0
+ rc = txn_begin( bi->bi_dbenv, NULL, &tid, 0 );
+#endif
- e = bdb_tool_entry_get( be, tid, id );
+ e = bdb_tool_entry_get( be, id );
if( e == NULL ) {
Debug( LDAP_DEBUG_ANY,
"bdb_tool_entry_reindex:: could not locate id=%ld\n",
(long) id, 0, 0 );
+#if 0
txn_abort( tid );
+#endif
return -1;
}
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n",
id, e->e_dn, 0 );
- rc = index_entry_add( be, e, e->e_attrs );
+ rc = bdb_index_entry_add( be, tid, e, e->e_attrs );
entry_free( e );