mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-12 15:23:11 -05:00
An incremental step.
This commit is contained in:
parent
3225c05cd5
commit
191853eb51
5 changed files with 19 additions and 10 deletions
|
|
@ -240,7 +240,7 @@ retry: rc = txn_abort( ltid );
|
|||
|
||||
#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 ) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -369,7 +369,11 @@ bdb_initialize(
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -129,10 +129,10 @@ int bdb_modify_internal(
|
|||
|
||||
#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 );
|
||||
|
|
|
|||
|
|
@ -184,28 +184,32 @@ done:
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +223,7 @@ int bdb_tool_entry_reindex(
|
|||
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 );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue