From 7afbb7420b7bd7f24d34b0edda51e62267f7523a Mon Sep 17 00:00:00 2001 From: panfengfeng Date: Wed, 21 Sep 2016 01:11:51 +0800 Subject: [PATCH] solve the problem of table_factory_to_write_=nullptr (#1342) --- table/adaptive_table_factory.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/table/adaptive_table_factory.cc b/table/adaptive_table_factory.cc index bb19c417e..f83905dff 100644 --- a/table/adaptive_table_factory.cc +++ b/table/adaptive_table_factory.cc @@ -20,9 +20,6 @@ AdaptiveTableFactory::AdaptiveTableFactory( block_based_table_factory_(block_based_table_factory), plain_table_factory_(plain_table_factory), cuckoo_table_factory_(cuckoo_table_factory) { - if (!table_factory_to_write_) { - table_factory_to_write_ = block_based_table_factory_; - } if (!plain_table_factory_) { plain_table_factory_.reset(NewPlainTableFactory()); } @@ -32,6 +29,9 @@ AdaptiveTableFactory::AdaptiveTableFactory( if (!cuckoo_table_factory_) { cuckoo_table_factory_.reset(NewCuckooTableFactory()); } + if (!table_factory_to_write_) { + table_factory_to_write_ = block_based_table_factory_; + } } extern const uint64_t kPlainTableMagicNumber;