Merge pull request #200 from rdallman/missing_cf

C API: create missing cf's, cleanup
This commit is contained in:
Igor Canadi 2014-07-10 13:29:40 -07:00
commit 3f53d2762f
3 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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(