mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: deprecate mdbx_dbi_open_ex() and custom comparators.
Change-Id: I1d20f77b9ba5d8d5ec891df17019377afb466b06
This commit is contained in:
parent
fab6ddee14
commit
e989cb05ed
@ -1,4 +1,5 @@
|
||||
## v0.9.x (in the development):
|
||||
- Since v0.9 usage of custom comparators and the `mdbx_dbi_open_ex()` are deprecated.
|
||||
- TODO: API for explicit threads (de)registration.
|
||||
- TODO: Native bindings for C++.
|
||||
- TODO: Packages for AltLinux, Fedora/RHEL, Debian/Ubuntu.
|
||||
|
4
mdbx.h
4
mdbx.h
@ -2678,8 +2678,8 @@ typedef int(MDBX_cmp_func)(const MDBX_val *a, const MDBX_val *b);
|
||||
* i.e. the passed flags is different with which the
|
||||
* database was created, or the database was already
|
||||
* opened with a different comparison function(s). */
|
||||
LIBMDBX_API int mdbx_dbi_open_ex(MDBX_txn *txn, const char *name,
|
||||
unsigned flags, MDBX_dbi *dbi,
|
||||
MDBX_DEPRECATED LIBMDBX_API int
|
||||
mdbx_dbi_open_ex(MDBX_txn *txn, const char *name, unsigned flags, MDBX_dbi *dbi,
|
||||
MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp);
|
||||
LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name, unsigned flags,
|
||||
MDBX_dbi *dbi);
|
||||
|
10
src/core.c
10
src/core.c
@ -16452,7 +16452,7 @@ static int mdbx_dbi_bind(MDBX_txn *txn, const MDBX_dbi dbi, unsigned user_flags,
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
int mdbx_dbi_open_ex(MDBX_txn *txn, const char *table_name, unsigned user_flags,
|
||||
static int dbi_open(MDBX_txn *txn, const char *table_name, unsigned user_flags,
|
||||
MDBX_dbi *dbi, MDBX_cmp_func *keycmp,
|
||||
MDBX_cmp_func *datacmp) {
|
||||
int rc = MDBX_EINVAL;
|
||||
@ -16673,7 +16673,13 @@ int mdbx_dbi_open_ex(MDBX_txn *txn, const char *table_name, unsigned user_flags,
|
||||
|
||||
int mdbx_dbi_open(MDBX_txn *txn, const char *table_name, unsigned table_flags,
|
||||
MDBX_dbi *dbi) {
|
||||
return mdbx_dbi_open_ex(txn, table_name, table_flags, dbi, nullptr, nullptr);
|
||||
return dbi_open(txn, table_name, table_flags, dbi, nullptr, nullptr);
|
||||
}
|
||||
|
||||
int mdbx_dbi_open_ex(MDBX_txn *txn, const char *table_name,
|
||||
unsigned table_flags, MDBX_dbi *dbi, MDBX_cmp_func *keycmp,
|
||||
MDBX_cmp_func *datacmp) {
|
||||
return dbi_open(txn, table_name, table_flags, dbi, keycmp, datacmp);
|
||||
}
|
||||
|
||||
int __cold mdbx_dbi_stat(MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *dest,
|
||||
|
Loading…
x
Reference in New Issue
Block a user