diff --git a/db/column_family.cc b/db/column_family.cc index df1c8434a4b..a0e66e7e5ce 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -50,6 +50,14 @@ ColumnFamilyHandleImpl::ColumnFamilyHandleImpl( } } +ColumnFamilyHandleImpl::ColumnFamilyHandleImpl( + const ColumnFamilyHandleImpl& other) + : cfd_(other.cfd_), db_(other.db_), mutex_(other.mutex_) { + if (cfd_ != nullptr) { + cfd_->Ref(); + } +} + ColumnFamilyHandleImpl::~ColumnFamilyHandleImpl() { if (cfd_ != nullptr) { #ifndef ROCKSDB_LITE diff --git a/db/column_family.h b/db/column_family.h index 897084477e3..1a3ca3797dd 100644 --- a/db/column_family.h +++ b/db/column_family.h @@ -162,6 +162,7 @@ class ColumnFamilyHandleImpl : public ColumnFamilyHandle { // create while holding the mutex ColumnFamilyHandleImpl( ColumnFamilyData* cfd, DBImpl* db, InstrumentedMutex* mutex); + ColumnFamilyHandleImpl(const ColumnFamilyHandleImpl& other); // destroy without mutex virtual ~ColumnFamilyHandleImpl(); virtual ColumnFamilyData* cfd() const { return cfd_; }