AttributeDescription *ad;
rc = mdb_cursor_open( txn, mdb->mi_ad2id, &mc );
- if ( rc )
+ if ( rc ) {
+ Debug( LDAP_DEBUG_ANY,
+ "mdb_ad_read: cursor_open failed %s(%d)\n",
+ mdb_strerror(rc), rc, 0);
return rc;
+ }
/* our array is 1-based, an index of 0 means no data */
i = mdb->mi_numads+1;
MDB_val key;
rc = mdb_ad_read( mdb, txn );
+ if (rc)
+ return rc;
+
if ( mdb->mi_adxs[ad->ad_index] )
return 0;
mdb->mi_adxs[ad->ad_index] = i;
mdb->mi_ads[i] = ad;
mdb->mi_numads++;
+ } else {
+ Debug( LDAP_DEBUG_ANY,
+ "mdb_ad_get: mdb_put failed %s(%d)\n",
+ mdb_strerror(rc), rc, 0);
}
return rc;
rc = mdb_entry_encode( op, tid, e, &data );
if( rc != LDAP_SUCCESS ) {
- return -1;
+ return LDAP_OTHER;
}
rc = mdb_put( tid, dbi, &key, &data, flag );
-
op->o_tmpfree( data.mv_data, op->o_tmpmemctx );
+ if (rc) {
+ Debug( LDAP_DEBUG_ANY,
+ "mdb_id2entry_put: mdb_put failed: %s(%d) \"%s\"\n",
+ mdb_strerror(rc), rc,
+ e->e_nname.bv_val );
+ rc = LDAP_OTHER;
+ }
return rc;
}
eh->bv.bv_len = len;
eh->nattrs = nat;
eh->nvals = nval;
+ return 0;
}
/* Flatten an Entry into a buffer. The buffer is filled with just the
; /* empty */
rc = mdb_entry_partsize( mdb, txn, e, &eh );
+ if (rc) return rc;
data->mv_size = eh.bv.bv_len;
data->mv_data = op->o_tmpalloc(data->mv_size, op->o_tmpmemctx);