]> git.sur5r.net Git - openldap/commitdiff
ITS#2895 store a copy in the entry cache
authorHoward Chu <hyc@openldap.org>
Wed, 24 Dec 2003 10:59:50 +0000 (10:59 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 24 Dec 2003 10:59:50 +0000 (10:59 +0000)
servers/slapd/back-bdb/add.c

index a96e590161e48c57f068e680cb69e24b982429c9..c807f24416ebfe26ebbdcc78acbba10e2b60367f 100644 (file)
@@ -476,18 +476,19 @@ retry:    /* transaction retry */
 
                } else {
                        struct berval nrdn;
+                       Entry *e = entry_dup( op->ora_e );
 
                        if (pdn.bv_len) {
-                               nrdn.bv_val = op->ora_e->e_nname.bv_val;
-                               nrdn.bv_len = pdn.bv_val - nrdn.bv_val - 1;
+                               nrdn.bv_val = e->e_nname.bv_val;
+                               nrdn.bv_len = pdn.bv_val - op->ora_e->e_nname.bv_val - 1;
                        } else {
-                               nrdn = op->ora_e->e_nname;
+                               nrdn = e->e_nname;
                        }
 
-                       bdb_cache_add( bdb, ei, op->oq_add.rs_e, &nrdn, locker );
+                       bdb_cache_add( bdb, ei, e, &nrdn, locker );
 
                        if ( suffix_ei == NULL ) {
-                               suffix_ei = op->oq_add.rs_e->e_private;
+                               suffix_ei = e->e_private;
                        }
 
                        if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {