goto return_results;
}
- rc = txn_commit( ltid, 0 );
+ if( op->o_noop ) {
+ rc = txn_abort( ltid );
+ } else {
+ rc = txn_commit( ltid, 0 );
+ }
ltid = NULL;
op->o_private = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "bdb_add: txn_commit failed: %s (%d)\n",
- db_strerror(rc), rc, 0 );
+ "bdb_add: txn_%s failed: %s (%d)\n",
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rc), rc );
rc = LDAP_OTHER;
text = "commit failed";
} else {
- /* add the entry to the entry cache */
- /* we should add to cache only upon free of txn-abort */
- if (bdb_cache_add_entry_rw(&bdb->bi_cache, e, CACHE_WRITE_LOCK) != 0) {
- text = "cache add failed";
- goto return_results;
- }
+ /* add the entry to the entry cache */
+ /* we should add to cache only upon free of txn-abort */
+ if (!op->o_noop &&
+ bdb_cache_add_entry_rw(&bdb->bi_cache, e, CACHE_WRITE_LOCK) != 0)
+ {
+ text = "cache add failed";
+ goto return_results;
+ }
Debug( LDAP_DEBUG_TRACE,
- "bdb_add: added id=%08lx dn=\"%s\"\n",
- e->e_id, e->e_dn, 0 );
+ "bdb_add: added%s id=%08lx dn=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
rc = LDAP_SUCCESS;
text = NULL;
}
- bdb_cache_entry_commit (e);
+ bdb_cache_entry_commit( e );
return_results:
send_ldap_result( conn, op, rc,
ldap_pvt_thread_mutex_unlock( &bdb->bi_lastid_mutex );
#endif
- rc = txn_commit( ltid, 0 );
+ if( op->o_noop ) {
+ rc = txn_abort( ltid );
+ } else {
+ rc = txn_commit( ltid, 0 );
+ }
ltid = NULL;
op->o_private = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "bdb_delete: txn_commit failed: %s (%d)\n",
- db_strerror(rc), rc, 0 );
+ "bdb_delete: txn_%s failed: %s (%d)\n",
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rc), rc );
rc = LDAP_OTHER;
text = "commit failed";
} else {
Debug( LDAP_DEBUG_TRACE,
- "bdb_delete: deleted id=%08lx dn=\"%s\"\n",
- e->e_id, e->e_dn, 0 );
+ "bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
rc = LDAP_SUCCESS;
text = NULL;
}
bdb_fix_dn(be, id, *e);
#endif
- if (rc == 0)
+ if (rc == 0) {
bdb_cache_entry_commit(*e);
+ }
return rc;
}
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
LDAP_CONTROL_SUBENTRIES,
-#if 0
LDAP_CONTROL_NOOP,
-#endif
NULL
};
goto return_results;
}
- rc = txn_commit( ltid, 0 );
+ if( op->o_noop ) {
+ rc = txn_abort( ltid );
+ } else {
+ rc = txn_commit( ltid, 0 );
+ }
ltid = NULL;
op->o_private = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "bdb_modify: txn_commit failed: %s (%d)\n",
- db_strerror(rc), rc, 0 );
+ "bdb_modify: txn_%s failed: %s (%d)\n",
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rc), rc );
rc = LDAP_OTHER;
text = "commit failed";
} else {
Debug( LDAP_DEBUG_TRACE,
- "bdb_modify: updated id=%08lx dn=\"%s\"\n",
+ "bdb_modify: updated%s id=%08lx dn=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn, 0 );
rc = LDAP_SUCCESS;
text = NULL;
goto return_results;
}
- rc = txn_commit( ltid, 0 );
+ if( op->o_noop ) {
+ rc = txn_abort( ltid );
+ } else {
+ rc = txn_commit( ltid, 0 );
+ }
ltid = NULL;
op->o_private = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "bdb_modrdn: txn_commit failed: %s (%d)\n",
- db_strerror(rc), rc, 0 );
+ "bdb_modrdn: txn_%s failed: %s (%d)\n",
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rc), rc );
rc = LDAP_OTHER;
text = "commit failed";
+
} else {
(void) bdb_cache_update_entry(&bdb->bi_cache, e);
Debug( LDAP_DEBUG_TRACE,
- "bdb_modrdn: added id=%08lx dn=\"%s\"\n",
- e->e_id, e->e_dn, 0 );
+ "bdb_modrdn: added%s id=%08lx dn=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
rc = LDAP_SUCCESS;
text = NULL;
bdb_cache_entry_commit( e );
}
if( rc == 0 ) {
- rc = txn_commit( ltid, 0 );
+ if( op->o_noop ) {
+ rc = txn_abort( ltid );
+ } else {
+ rc = txn_commit( ltid, 0 );
+ }
ltid = NULL;
}
op->o_private = NULL;