]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit
authorHoward Chu <hyc@openldap.org>
Fri, 5 Mar 2004 19:29:02 +0000 (19:29 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 5 Mar 2004 19:29:02 +0000 (19:29 +0000)
servers/slapd/back-bdb/idl.c

index f86b7e68d9a3d6de170e4aab0ef6ae6bcbcd1df2..3620f0285dcdc0f49bb217849dc87615baf57905 100644 (file)
@@ -734,7 +734,7 @@ bdb_idl_insert_key(
                                break;
                        }
                        tmp = id;
-                       rc = cursor->c_put( cursor, key, &data, DB_CURRENT );
+                       rc = cursor->c_put( cursor, key, &data, DB_KEYFIRST );
                        if ( rc != 0 ) {
                                cursor->c_close( cursor );
                                err = "c_put";
@@ -767,6 +767,7 @@ bdb_idl_insert_key(
        }
 
        if ( bdb->bi_idl_cache_max_size ) {
+               bdb_idl_cache_del( bdb, db, key );
                bdb_idl_cache_put( bdb, db, key, idl, 0 );
        }
        return rc;
@@ -862,7 +863,7 @@ bdb_idl_delete_key(
        }
        if ( isrange && rc == 0 ) {
                tmp = ( id == lo ) ? idl[1] : idl[2];
-               rc = cursor->c_put( cursor, key, &data, DB_CURRENT );
+               rc = cursor->c_put( cursor, key, &data, DB_KEYFIRST );
                if ( rc != 0 ) {
                        err = "c_put";
                }
@@ -892,6 +893,7 @@ bdb_idl_delete_key(
                return rc;
        }
        if ( bdb->bi_idl_cache_max_size ) {
+               bdb_idl_cache_del( bdb, db, key );
                bdb_idl_cache_put( bdb, db, key, idl, 0 );
        }