From 1fc71a4b16c4ec0da0ce78f8ae58c6d448228ece Mon Sep 17 00:00:00 2001 From: Reed Allman Date: Thu, 10 Jul 2014 12:53:46 -0700 Subject: [PATCH] C API: create missing cf's, cleanup --- db/c.cc | 5 +++++ db/c_test.c | 1 - include/rocksdb/c.h | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/db/c.cc b/db/c.cc index ada7287a9..57828550e 100644 --- a/db/c.cc +++ b/db/c.cc @@ -1015,6 +1015,11 @@ void rocksdb_options_set_create_if_missing( opt->rep.create_if_missing = v; } +void rocksdb_options_set_create_missing_column_families( + rocksdb_options_t* opt, unsigned char v) { + opt->rep.create_missing_column_families = v; +} + void rocksdb_options_set_error_if_exists( rocksdb_options_t* opt, unsigned char v) { opt->rep.error_if_exists = v; diff --git a/db/c_test.c b/db/c_test.c index ff8c7da0b..c900036ca 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -576,7 +576,6 @@ int main(int argc, char** argv) { size_t cflen; char** column_fams = rocksdb_list_column_families(db_options, dbname, &cflen, &err); CheckNoError(err); - // TODO column_families vals seg fault CheckEqual("default", column_fams[0], 7); CheckEqual("cf1", column_fams[1], 3); CheckCondition(cflen == 2); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 115909cd3..35772479a 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -133,7 +133,7 @@ extern void rocksdb_drop_column_family( rocksdb_column_family_handle_t* handle, char** errptr); -extern void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t* handle); +extern void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t*); extern void rocksdb_close(rocksdb_t* db); @@ -373,6 +373,8 @@ extern void rocksdb_options_set_filter_policy( rocksdb_filterpolicy_t*); extern void rocksdb_options_set_create_if_missing( rocksdb_options_t*, unsigned char); +extern void rocksdb_options_set_create_missing_column_families( + rocksdb_options_t*, unsigned char); extern void rocksdb_options_set_error_if_exists( rocksdb_options_t*, unsigned char); extern void rocksdb_options_set_paranoid_checks(