ITS#3559 fix hdb dn2idl idl_cache usage

This commit is contained in:
Howard Chu 2005-02-21 11:11:00 +00:00
parent 4295f398af
commit 2b725a3dfe

View File

@ -825,6 +825,16 @@ hdb_dn2idl_internal(
struct dn2id_cookie *cx struct dn2id_cookie *cx
) )
{ {
BDB_IDL_ZERO( cx->tmp );
if ( !cx->ei ) {
cx->ei = bdb_cache_find_info( cx->bdb, cx->id );
if ( !cx->ei ) {
cx->rc = DB_NOTFOUND;
goto saveit;
}
}
if ( cx->bdb->bi_idl_cache_size ) { if ( cx->bdb->bi_idl_cache_size ) {
cx->key.data = &cx->id; cx->key.data = &cx->id;
cx->rc = bdb_idl_cache_get(cx->bdb, cx->db, &cx->key, cx->tmp); cx->rc = bdb_idl_cache_get(cx->bdb, cx->db, &cx->key, cx->tmp);
@ -835,15 +845,6 @@ hdb_dn2idl_internal(
goto gotit; goto gotit;
} }
} }
BDB_IDL_ZERO( cx->tmp );
if ( !cx->ei ) {
cx->ei = bdb_cache_find_info( cx->bdb, cx->id );
if ( !cx->ei ) {
cx->rc = DB_NOTFOUND;
goto saveit;
}
}
bdb_cache_entryinfo_lock( cx->ei ); bdb_cache_entryinfo_lock( cx->ei );