mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-19 21:32:58 -05:00
Fix indexing bug in splitting indirect blocks
This commit is contained in:
parent
33d5c0abd7
commit
b3ddb5734b
1 changed files with 17 additions and 5 deletions
|
|
@ -48,17 +48,29 @@ static void cont_free( Datum *cont )
|
||||||
#ifdef LDBM_DEBUG_IDL
|
#ifdef LDBM_DEBUG_IDL
|
||||||
static void idl_check(ID_BLOCK *idl)
|
static void idl_check(ID_BLOCK *idl)
|
||||||
{
|
{
|
||||||
int i;
|
int i, max;
|
||||||
ID_BLOCK last;
|
ID_BLOCK last;
|
||||||
|
|
||||||
if( ID_BLOCK_INDIRECT(idl) || ID_BLOCK_ALLIDS(idl)
|
if( ID_BLOCK_ALLIDS(idl) )
|
||||||
|| ID_BLOCK_NIDS(idl) <= 1 )
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#ifndef USE_INDIRECT_NIDS
|
||||||
|
if( ID_BLOCK_INDIRECT(idl) )
|
||||||
|
{
|
||||||
|
for ( max = 0; !ID_BLOCK_BOID(idl, max); max++ ) ;
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
max = ID_BLOCK_NIDS(idl);
|
||||||
|
}
|
||||||
|
if ( max <= 1 )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( last = ID_BLOCK_ID(idl, 0), i = 1;
|
for( last = ID_BLOCK_ID(idl, 0), i = 1;
|
||||||
i < ID_BLOCK_NIDS(idl);
|
i < max;
|
||||||
last = ID_BLOCK_ID(idl, i), i++ )
|
last = ID_BLOCK_ID(idl, i), i++ )
|
||||||
{
|
{
|
||||||
assert (last < ID_BLOCK_ID(idl, i) );
|
assert (last < ID_BLOCK_ID(idl, i) );
|
||||||
|
|
@ -628,7 +640,7 @@ idl_insert_key(
|
||||||
#endif
|
#endif
|
||||||
/* read it in */
|
/* read it in */
|
||||||
cont_alloc( &k2, &key );
|
cont_alloc( &k2, &key );
|
||||||
cont_id( &k2, ID_BLOCK_ID(idl, i) );
|
cont_id( &k2, ID_BLOCK_ID(idl, i + 1) );
|
||||||
if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) {
|
if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) {
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG( INDEX, ERR,
|
LDAP_LOG( INDEX, ERR,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue