mirror of
https://github.com/isar/libmdbx.git
synced 2025-03-03 16:58:14 +08:00
mdbx: add MDBX_EKEYMISMATCH.
This commit is contained in:
parent
d9eeac45b2
commit
82d3595b76
4
mdbx.h
4
mdbx.h
@ -328,6 +328,10 @@ typedef enum MDB_cursor_op {
|
||||
* right now (e.g. in readonly mode and so forth). */
|
||||
#define MDBX_WANNA_RECOVERY (-30419)
|
||||
|
||||
/* The given key value is mismatched to the current cursor position,
|
||||
* when mdbx_cursor_put() called with MDB_CURRENT option. */
|
||||
#define MDBX_EKEYMISMATCH (-30418)
|
||||
|
||||
/* Statistics for a database in the environment */
|
||||
typedef struct MDBX_stat {
|
||||
unsigned ms_psize; /* Size of a database page.
|
||||
|
@ -759,6 +759,9 @@ static const char *__mdbx_strerr(int errnum) {
|
||||
case MDBX_WANNA_RECOVERY:
|
||||
return "MDBX_WANNA_RECOVERY: Database should be recovered, but this could "
|
||||
"be done in a read-only mode";
|
||||
case MDBX_EKEYMISMATCH:
|
||||
return "MDBX_EKEYMISMATCH: The given key value is mismatched to the "
|
||||
"current cursor position";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@ -5729,7 +5732,7 @@ int mdbx_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
|
||||
mc->mc_ki[mc->mc_top]++;
|
||||
} else {
|
||||
/* new key is <= last key */
|
||||
rc = MDB_KEYEXIST;
|
||||
rc = MDBX_EKEYMISMATCH;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user