mirror of
https://github.com/isar/libmdbx.git
synced 2025-04-01 02:32:57 +08:00
mdbx: удаление const
у транзакции в cursor_bind()
и cursor_renew()
.
This commit is contained in:
parent
bc464521c0
commit
fbb93f9cfb
6
mdbx.h
6
mdbx.h
@ -5139,7 +5139,7 @@ MDBX_NOTHROW_PURE_FUNCTION LIBMDBX_API void *mdbx_cursor_get_userctx(const MDBX_
|
||||
* \retval MDBX_THREAD_MISMATCH Given transaction is not owned
|
||||
* by current thread.
|
||||
* \retval MDBX_EINVAL An invalid parameter was specified. */
|
||||
LIBMDBX_API int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *cursor, MDBX_dbi dbi);
|
||||
LIBMDBX_API int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *cursor, MDBX_dbi dbi);
|
||||
|
||||
/** \brief Unbind cursor from a transaction.
|
||||
* \ingroup c_cursors
|
||||
@ -5208,7 +5208,7 @@ LIBMDBX_API int mdbx_cursor_reset(MDBX_cursor *cursor);
|
||||
* \retval MDBX_THREAD_MISMATCH Given transaction is not owned
|
||||
* by current thread.
|
||||
* \retval MDBX_EINVAL An invalid parameter was specified. */
|
||||
LIBMDBX_API int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **cursor);
|
||||
LIBMDBX_API int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **cursor);
|
||||
|
||||
/** \brief Close a cursor handle.
|
||||
* \ingroup c_cursors
|
||||
@ -5271,7 +5271,7 @@ LIBMDBX_API int mdbx_txn_release_all_cursors(const MDBX_txn *txn, bool unbind);
|
||||
* \retval MDBX_EINVAL An invalid parameter was specified.
|
||||
* \retval MDBX_BAD_DBI The cursor was not bound to a DBI-handle
|
||||
* or such a handle became invalid. */
|
||||
LIBMDBX_API int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *cursor);
|
||||
LIBMDBX_API int mdbx_cursor_renew(MDBX_txn *txn, MDBX_cursor *cursor);
|
||||
|
||||
/** \brief Return the cursor's transaction handle.
|
||||
* \ingroup c_cursors
|
||||
|
8
mdbx.h++
8
mdbx.h++
@ -4474,11 +4474,11 @@ public:
|
||||
|
||||
/// \brief Renew/bind a cursor with a new transaction and previously used
|
||||
/// key-value map handle.
|
||||
inline void renew(const ::mdbx::txn &txn);
|
||||
inline void renew(::mdbx::txn &txn);
|
||||
|
||||
/// \brief Bind/renew a cursor with a new transaction and specified key-value
|
||||
/// map handle.
|
||||
inline void bind(const ::mdbx::txn &txn, ::mdbx::map_handle map_handle);
|
||||
inline void bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle);
|
||||
|
||||
/// \brief Unbind cursor from a transaction.
|
||||
inline void unbind();
|
||||
@ -6167,9 +6167,9 @@ inline cursor::estimate_result cursor::estimate(move_operation operation) const
|
||||
return estimate_result(*this, operation);
|
||||
}
|
||||
|
||||
inline void cursor::renew(const ::mdbx::txn &txn) { error::success_or_throw(::mdbx_cursor_renew(txn, handle_)); }
|
||||
inline void cursor::renew(::mdbx::txn &txn) { error::success_or_throw(::mdbx_cursor_renew(txn, handle_)); }
|
||||
|
||||
inline void cursor::bind(const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) {
|
||||
inline void cursor::bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle) {
|
||||
error::success_or_throw(::mdbx_cursor_bind(txn, handle_, map_handle.dbi));
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ MDBX_cursor *mdbx_cursor_create(void *context) {
|
||||
return &couple->outer;
|
||||
}
|
||||
|
||||
int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *mc) {
|
||||
int mdbx_cursor_renew(MDBX_txn *txn, MDBX_cursor *mc) {
|
||||
return likely(mc) ? mdbx_cursor_bind(txn, mc, (kvx_t *)mc->clc - txn->env->kvs) : LOG_IFERR(MDBX_EINVAL);
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ int mdbx_cursor_reset(MDBX_cursor *mc) {
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) {
|
||||
int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) {
|
||||
if (unlikely(!mc))
|
||||
return LOG_IFERR(MDBX_EINVAL);
|
||||
|
||||
@ -88,7 +88,7 @@ int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) {
|
||||
|
||||
mc->next = txn->cursors[dbi];
|
||||
txn->cursors[dbi] = mc;
|
||||
((MDBX_txn *)txn)->flags |= txn_may_have_cursors;
|
||||
txn->flags |= txn_may_have_cursors;
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ int mdbx_cursor_unbind(MDBX_cursor *mc) {
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **ret) {
|
||||
int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **ret) {
|
||||
if (unlikely(!ret))
|
||||
return LOG_IFERR(MDBX_EINVAL);
|
||||
*ret = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user