diff --git a/db/column_family_test.cc b/db/column_family_test.cc index 93dc771ad..1d5619995 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -2827,6 +2827,27 @@ TEST_F(ColumnFamilyTest, CreateAndDestoryOptions) { ASSERT_OK(db_->DestroyColumnFamilyHandle(cfh)); } +TEST_F(ColumnFamilyTest, CreateDropAndDestroy) { + ColumnFamilyHandle* cfh; + Open(); + ASSERT_OK(db_->CreateColumnFamily(ColumnFamilyOptions(), "yoyo", &cfh)); + ASSERT_OK(db_->Put(WriteOptions(), cfh, "foo", "bar")); + ASSERT_OK(db_->Flush(FlushOptions(), cfh)); + ASSERT_OK(db_->DropColumnFamily(cfh)); + ASSERT_OK(db_->DestroyColumnFamilyHandle(cfh)); +} + +TEST_F(ColumnFamilyTest, CreateDropAndDestroyWithoutFileDeletion) { + ColumnFamilyHandle* cfh; + Open(); + ASSERT_OK(db_->CreateColumnFamily(ColumnFamilyOptions(), "yoyo", &cfh)); + ASSERT_OK(db_->Put(WriteOptions(), cfh, "foo", "bar")); + ASSERT_OK(db_->Flush(FlushOptions(), cfh)); + ASSERT_OK(db_->DisableFileDeletions()); + ASSERT_OK(db_->DropColumnFamily(cfh)); + ASSERT_OK(db_->DestroyColumnFamilyHandle(cfh)); +} + #ifndef ROCKSDB_LITE TEST_F(ColumnFamilyTest, FlushCloseWALFiles) { SpecialEnv env(Env::Default()); diff --git a/table/block_based_table_reader.h b/table/block_based_table_reader.h index 0b58c84e1..4baed2a60 100644 --- a/table/block_based_table_reader.h +++ b/table/block_based_table_reader.h @@ -429,7 +429,7 @@ struct BlockBasedTable::Rep { const ImmutableCFOptions& ioptions; const EnvOptions& env_options; - const BlockBasedTableOptions& table_options; + const BlockBasedTableOptions table_options; const FilterPolicy* const filter_policy; const InternalKeyComparator& internal_comparator; Status status;