From: Hallvard Furuseth Date: Thu, 8 Aug 2013 17:57:51 +0000 (+0200) Subject: Set MDB_TXN_ERROR when inconsistent txn state X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~12^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ee5ba855651df54130a53daa8f5b638894343230;p=openldap Set MDB_TXN_ERROR when inconsistent txn state --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index c2e75e54aa..aeaf4dfd8f 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -1495,7 +1495,7 @@ mdb_page_spill(MDB_cursor *m0, MDB_val *key, MDB_val *data) continue; } if ((rc = mdb_midl_append(&txn->mt_spill_pgs, dl[i].mid))) - return rc; + goto done; } mdb_midl_sort(txn->mt_spill_pgs); @@ -1503,6 +1503,7 @@ mdb_page_spill(MDB_cursor *m0, MDB_val *key, MDB_val *data) mdb_cursorpages_mark(m0, P_DIRTY|P_KEEP); +done: if (rc == 0) { if (txn->mt_parent) { MDB_txn *tx2; @@ -1525,6 +1526,8 @@ mdb_page_spill(MDB_cursor *m0, MDB_val *key, MDB_val *data) txn->mt_dirty_room = MDB_IDL_UM_MAX - dl[0].mid; } txn->mt_flags |= MDB_TXN_SPILLS; + } else { + txn->mt_flags |= MDB_TXN_ERROR; } return rc; }