From 8b045ab6264fbd49f2985073115095eacd04f286 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Tue, 24 Jan 2017 15:38:20 +0300 Subject: [PATCH] mdbx: MDBX_EMULTIVAL errcode for libfpta. --- mdb.c | 2 +- mdbx.c | 2 +- mdbx.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mdb.c b/mdb.c index 08dccaaa..f9a3737a 100644 --- a/mdb.c +++ b/mdb.c @@ -9254,7 +9254,7 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, MDB_node *leaf = NODEPTR(mc.mc_pg[mc.mc_top], mc.mc_ki[mc.mc_top]); if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1); - rc = MDB_KEYEXIST; + rc = MDBX_EMULTIVAL; } } } diff --git a/mdbx.c b/mdbx.c index 611a87e9..6e3cb210 100644 --- a/mdbx.c +++ b/mdbx.c @@ -468,7 +468,7 @@ int mdbx_replace(MDB_txn *txn, MDB_dbi dbi, MDB_node *leaf = NODEPTR(page, mc.mc_ki[mc.mc_top]); if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1); - rc = MDB_KEYEXIST; + rc = MDBX_EMULTIVAL; goto bailout; } /* если данные совпадают, то ничего делать не надо */ diff --git a/mdbx.h b/mdbx.h index 7fd09d67..83315e54 100644 --- a/mdbx.h +++ b/mdbx.h @@ -223,6 +223,8 @@ size_t mdbx_canary_get(MDB_txn *txn, mdbx_canary* canary); * 0 otherwise or less that zero in error case. */ int mdbx_cursor_eof(MDB_cursor *mc); +#define MDBX_EMULTIVAL (MDB_LAST_ERRCODE - 42) + int mdbx_replace(MDB_txn *txn, MDB_dbi dbi, MDB_val *key, MDB_val *new_data, MDB_val *old_data, unsigned flags); /* Same as mdbx_get(), but also return the count