mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:44:13 +08:00
mdbx: MDBX_EMULTIVAL errcode for libfpta.
This commit is contained in:
parent
688b711e31
commit
8b045ab626
2
mdb.c
2
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]);
|
MDB_node *leaf = NODEPTR(mc.mc_pg[mc.mc_top], mc.mc_ki[mc.mc_top]);
|
||||||
if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
||||||
mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1);
|
mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1);
|
||||||
rc = MDB_KEYEXIST;
|
rc = MDBX_EMULTIVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
mdbx.c
2
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]);
|
MDB_node *leaf = NODEPTR(page, mc.mc_ki[mc.mc_top]);
|
||||||
if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
||||||
mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1);
|
mdb_tassert(txn, XCURSOR_INITED(&mc) && mc.mc_xcursor->mx_db.md_entries > 1);
|
||||||
rc = MDB_KEYEXIST;
|
rc = MDBX_EMULTIVAL;
|
||||||
goto bailout;
|
goto bailout;
|
||||||
}
|
}
|
||||||
/* если данные совпадают, то ничего делать не надо */
|
/* если данные совпадают, то ничего делать не надо */
|
||||||
|
2
mdbx.h
2
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. */
|
* 0 otherwise or less that zero in error case. */
|
||||||
int mdbx_cursor_eof(MDB_cursor *mc);
|
int mdbx_cursor_eof(MDB_cursor *mc);
|
||||||
|
|
||||||
|
#define MDBX_EMULTIVAL (MDB_LAST_ERRCODE - 42)
|
||||||
|
|
||||||
int mdbx_replace(MDB_txn *txn, MDB_dbi dbi,
|
int mdbx_replace(MDB_txn *txn, MDB_dbi dbi,
|
||||||
MDB_val *key, MDB_val *new_data, MDB_val *old_data, unsigned flags);
|
MDB_val *key, MDB_val *new_data, MDB_val *old_data, unsigned flags);
|
||||||
/* Same as mdbx_get(), but also return the count
|
/* Same as mdbx_get(), but also return the count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user