From 2bf1151a25de5c711d0c863973c2d995e1137c60 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Mon, 24 Feb 2014 15:15:34 -0800 Subject: [PATCH] Fix C API --- db/c.cc | 2 +- db/c_test.c | 4 +--- include/rocksdb/c.h | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/db/c.cc b/db/c.cc index 2d4f49188..935a297f1 100644 --- a/db/c.cc +++ b/db/c.cc @@ -595,7 +595,7 @@ void rocksdb_options_set_comparator( opt->rep.comparator = cmp; } -void rocksdb_options_set_merger_operator( +void rocksdb_options_set_merge_operator( rocksdb_options_t* opt, rocksdb_mergeoperator_t* merge_operator) { opt->rep.merge_operator = std::shared_ptr(merge_operator); diff --git a/db/c_test.c b/db/c_test.c index f4e5568fa..a68abca48 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -416,7 +416,7 @@ int main(int argc, char** argv) { // Create new database rocksdb_close(db); rocksdb_destroy_db(options, dbname, &err); - rocksdb_options_set_merger_operator(options, merge_operator); + rocksdb_options_set_merge_operator(options, merge_operator); db = rocksdb_open(options, dbname, &err); CheckNoError(err); rocksdb_put(db, woptions, "foo", 3, "foovalue", 8, &err); @@ -431,8 +431,6 @@ int main(int argc, char** argv) { CheckNoError(err); CheckGet(db, roptions, "bar", "fake"); - rocksdb_options_set_merger_operator(options, NULL); - rocksdb_mergeoperator_destroy(merge_operator); } StartPhase("cleanup"); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 2157cb3e0..91efed37f 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -216,9 +216,8 @@ extern void rocksdb_options_destroy(rocksdb_options_t*); extern void rocksdb_options_set_comparator( rocksdb_options_t*, rocksdb_comparator_t*); -extern void rocksdb_options_set_merger_operator( - rocksdb_options_t*, - rocksdb_mergeoperator_t*); +extern void rocksdb_options_set_merge_operator(rocksdb_options_t*, + rocksdb_mergeoperator_t*); extern void rocksdb_options_set_compression_per_level( rocksdb_options_t* opt, int* level_values,