diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-07-16 12:48:55 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-07-16 12:49:29 +0200 |
commit | dc624849bf602072fc91ea4182462b5660888c76 (patch) | |
tree | 44df6c7b56ca141e8348f0ff0586577e62820758 /external/db_drivers/liblmdb64/mtest4.c | |
parent | Merge pull request #338 (diff) | |
parent | fixed ARM arch test to prevent breaking on short arch strings (diff) | |
download | monero-dc624849bf602072fc91ea4182462b5660888c76.tar.xz |
Merge pull request #339
54c785d fixed ARM arch test to prevent breaking on short arch strings (Riccardo Spagni)
a4254a4 updated vl32 to current (Riccardo Spagni)
e6ab2df updated in-source lmdb (Riccardo Spagni)
ea08c76 open() flag O_DSYNC isn't on BSD, use O_SYNC (Thomas Winget)
Diffstat (limited to 'external/db_drivers/liblmdb64/mtest4.c')
-rw-r--r-- | external/db_drivers/liblmdb64/mtest4.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/external/db_drivers/liblmdb64/mtest4.c b/external/db_drivers/liblmdb64/mtest4.c index fdcd46a37..6df890e2d 100644 --- a/external/db_drivers/liblmdb64/mtest4.c +++ b/external/db_drivers/liblmdb64/mtest4.c @@ -51,8 +51,9 @@ int main(int argc,char * argv[]) E(mdb_env_set_mapsize(env, 10485760)); E(mdb_env_set_maxdbs(env, 4)); E(mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664)); + E(mdb_txn_begin(env, NULL, 0, &txn)); - E(mdb_open(txn, "id4", MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED, &dbi)); + E(mdb_dbi_open(txn, "id4", MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED, &dbi)); key.mv_size = sizeof(int); key.mv_data = kval; @@ -72,7 +73,7 @@ int main(int argc,char * argv[]) /* there should be one full page of dups now. */ - E(mdb_txn_begin(env, NULL, 1, &txn)); + E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn)); E(mdb_cursor_open(txn, dbi, &cursor)); while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) { printf("key: %p %.*s, data: %p %.*s\n", @@ -142,7 +143,7 @@ int main(int argc,char * argv[]) printf("Deleted %d values\n", j); E(mdb_env_stat(env, &mst)); - E(mdb_txn_begin(env, NULL, 1, &txn)); + E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn)); E(mdb_cursor_open(txn, dbi, &cursor)); printf("Cursor next\n"); while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) { @@ -159,10 +160,9 @@ int main(int argc,char * argv[]) } CHECK(rc == MDB_NOTFOUND, "mdb_cursor_get"); mdb_cursor_close(cursor); - mdb_close(env, dbi); - mdb_txn_abort(txn); - mdb_env_close(env); + mdb_dbi_close(env, dbi); + mdb_env_close(env); return 0; } |