mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:54:14 +08:00
mdbx: backport - ITS#8319 mdb_load: explain readline and mdb_cursor_put errors.
Change-Id: I99e8ff220bb37109da83bb6088be7597b52c6f00
This commit is contained in:
parent
aeea7ebb08
commit
a8e2288537
1
CHANGES
1
CHANGES
@ -21,6 +21,7 @@ LMDB 0.9.17 Release Engineering
|
||||
Fix ITS#8313 mdb_rebalance dummy cursor
|
||||
Fix ITS#8315 dirty_room in nested txn
|
||||
Fix ITS#8316 page_merge cursor tracking
|
||||
Fix ITS#8319 mdb_load error messages
|
||||
Fix ITS#8321 cursor tracking
|
||||
Added mdb_txn_id() (ITS#7994)
|
||||
Added robust mutex support
|
||||
|
12
mdb_load.c
12
mdb_load.c
@ -399,20 +399,22 @@ int main(int argc, char *argv[])
|
||||
|
||||
while(1) {
|
||||
rc = readline(&key, &kbuf);
|
||||
if (rc == EOF)
|
||||
if (rc) /* rc == EOF */
|
||||
break;
|
||||
if (rc)
|
||||
goto txn_abort;
|
||||
|
||||
rc = readline(&data, &dbuf);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
fprintf(stderr, "%s: line %" Z "d: failed to read key value\n", prog, lineno);
|
||||
goto txn_abort;
|
||||
}
|
||||
|
||||
rc = mdb_cursor_put(mc, &key, &data, putflags);
|
||||
if (rc == MDB_KEYEXIST && putflags)
|
||||
continue;
|
||||
if (rc)
|
||||
if (rc) {
|
||||
fprintf(stderr, "mdb_cursor_put failed, error %d %s\n", rc, mdb_strerror(rc));
|
||||
goto txn_abort;
|
||||
}
|
||||
batch++;
|
||||
if (batch == 100) {
|
||||
rc = mdb_txn_commit(txn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user