]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/tools.c
Ditch LRU cache replacement in favor of 2nd-chance/clock.
[openldap] / servers / slapd / back-bdb / tools.c
index e16be3f66bb1c108f09aa173154ecdc9772228a7..f3830331c6f199f73251a03caefc269958b287c0 100644 (file)
@@ -273,7 +273,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
        data.flags ^= DB_DBT_PARTIAL;
        data.ulen = 0;
     rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
-       if ( rc != ENOMEM ) goto leave;
+       if ( rc != DB_BUFFER_SMALL ) goto leave;
 
        /* Allocate a block and retrieve the data */
        eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;
@@ -424,6 +424,9 @@ bdb_tool_index_add(
 {
        struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
 
+       if ( !bdb->bi_nattrs )
+               return 0;
+
        if ( slapMode & SLAP_TOOL_QUICK ) {
                IndexRec *ir;
                int i, rc;