X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-mdb%2Fadd.c;h=26bd264cc79c3e32e2bb9a1c9b23ecdd1d70f2f7;hb=59e9ff6243465640956b58ad1756a3ede53eca7c;hp=0f5480d86bd859706da9e48ba612056eb92eccad;hpb=83734af7cb3d6293fe6d8303a0bf4d484fe7b41e;p=openldap diff --git a/servers/slapd/back-mdb/add.c b/servers/slapd/back-mdb/add.c index 0f5480d86b..26bd264cc7 100644 --- a/servers/slapd/back-mdb/add.c +++ b/servers/slapd/back-mdb/add.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2000-2015 The OpenLDAP Foundation. + * Copyright 2000-2018 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ mdb_add(Operation *op, SlapReply *rs ) ID eid, pid = 0; mdb_op_info opinfo = {{{ 0 }}}, *moi = &opinfo; int subentry; + int numads = mdb->mi_numads; int success; @@ -368,6 +369,7 @@ mdb_add(Operation *op, SlapReply *rs ) LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next ); opinfo.moi_oe.oe_key = NULL; if ( op->o_noop ) { + mdb->mi_numads = numads; mdb_txn_abort( txn ); rs->sr_err = LDAP_X_NO_OPERATION; txn = NULL; @@ -377,6 +379,7 @@ mdb_add(Operation *op, SlapReply *rs ) rs->sr_err = mdb_txn_commit( txn ); txn = NULL; if ( rs->sr_err != 0 ) { + mdb->mi_numads = numads; rs->sr_text = "txn_commit failed"; Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(mdb_add) ": %s : %s (%d)\n", @@ -400,6 +403,7 @@ return_results: if( moi == &opinfo ) { if( txn != NULL ) { + mdb->mi_numads = numads; mdb_txn_abort( txn ); } if ( opinfo.moi_oe.oe_key ) {