mdbx-tools: use mdbx_cursor_bind() inside the mdbx_load.

Change-Id: I632841817331dfd493125c95350ec79e26147171
This commit is contained in:
Leonid Yuriev 2020-10-30 17:38:37 +03:00
parent 0f64d0ee95
commit d9ceb84445

View File

@ -742,9 +742,7 @@ int main(int argc, char *argv[]) {
goto txn_abort;
}
if (batch == 10000 || txn_info.txn_space_dirty > MEGABYTE * 16) {
mdbx_cursor_close(mc);
mc = nullptr;
if (batch == 10000 || txn_info.txn_space_dirty > MEGABYTE * 256) {
rc = mdbx_txn_commit(txn);
if (unlikely(rc != MDBX_SUCCESS)) {
error("mdbx_txn_commit", rc);
@ -757,9 +755,9 @@ int main(int argc, char *argv[]) {
error("mdbx_txn_begin", rc);
goto env_close;
}
rc = mdbx_cursor_open(txn, dbi, &mc);
rc = mdbx_cursor_bind(txn, mc, dbi);
if (unlikely(rc != MDBX_SUCCESS)) {
error("mdbx_cursor_open", rc);
error("mdbx_cursor_bind", rc);
goto txn_abort;
}
}