ITS#10125 mdb_load: fix cursor reinit in Append mode

This commit is contained in:
Howard Chu 2023-11-05 17:34:03 +00:00
parent d9b765a3af
commit 4629098737
No known key found for this signature in database
GPG Key ID: FD2A70B44AB11BA7
1 changed files with 4 additions and 2 deletions

View File

@ -445,7 +445,7 @@ int main(int argc, char *argv[])
if (rc == MDB_KEYEXIST && putflags)
continue;
if (rc) {
fprintf(stderr, "mdb_cursor_put failed, error %d %s\n", rc, mdb_strerror(rc));
fprintf(stderr, "%s: line %"Yu": mdb_cursor_put failed, error %d %s\n", prog, lineno, rc, mdb_strerror(rc));
goto txn_abort;
}
batch++;
@ -466,9 +466,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
if (appflag & MDB_APPENDDUP) {
if (append) {
MDB_val k, d;
mdb_cursor_get(mc, &k, &d, MDB_LAST);
memcpy(prevk.mv_data, k.mv_data, k.mv_size);
prevk.mv_size = k.mv_size;
}
batch = 0;
}