diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 10eb897..954ffde 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -1252,7 +1252,7 @@ int mdb_cmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b); /** @brief Compare two data items according to a particular database. * * This returns a comparison as if the two items were data items of - * a sorted duplicates #MDB_DUPSORT database. + * the specified database. The database must have the #MDB_DUPSORT flag. * @param[in] txn A transaction handle returned by #mdb_txn_begin() * @param[in] dbi A database handle returned by #mdb_dbi_open() * @param[in] a The first item to compare diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 0df2142..b6e85a5 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -1246,10 +1246,7 @@ mdb_cmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b) int mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b) { - if (txn->mt_dbxs[dbi].md_dcmp) - return txn->mt_dbxs[dbi].md_dcmp(a, b); - else - return EINVAL; /* too bad you can't distinguish this from a valid result */ + return txn->mt_dbxs[dbi].md_dcmp(a, b); } /** Allocate a single page.