Commit 309a366c authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

corrected bug with berkeleydb datastore implementation

parent 706fb3cb
......@@ -158,7 +158,7 @@ bool BerkeleyDBDataStore::put(const ds_bulk_t &key, const ds_bulk_t &data) {
Dbt db_data((void*)&(data[0]), uint32_t(data.size()));
db_key.set_flags(DB_DBT_USERMEM);
db_data.set_flags(DB_DBT_USERMEM);
uint32_t flags = DB_NOOVERWRITE; // to simply overwrite value, don't use this flag
uint32_t flags = _duplicates == Duplicates::IGNORE ? DB_NODUPDATA : 0;
status = _dbm->put(NULL, &db_key, &db_data, flags);
if (status == 0 ||
(_duplicates == Duplicates::IGNORE && status == DB_KEYEXIST)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment