diff --git a/dbms/include/DB/Storages/StorageChunks.h b/dbms/include/DB/Storages/StorageChunks.h index 653aa7a79cc..7a77b266cc9 100644 --- a/dbms/include/DB/Storages/StorageChunks.h +++ b/dbms/include/DB/Storages/StorageChunks.h @@ -66,6 +66,8 @@ private: CounterInFile reference_counter; Context context; + Logger * log; + StorageChunks(const std::string & path_, const std::string & name_, const std::string & database_name_, diff --git a/dbms/src/Storages/StorageChunks.cpp b/dbms/src/Storages/StorageChunks.cpp index dda110e2016..e94a9080572 100644 --- a/dbms/src/Storages/StorageChunks.cpp +++ b/dbms/src/Storages/StorageChunks.cpp @@ -76,7 +76,7 @@ BlockOutputStreamPtr StorageChunks::writeToNewChunk( } StorageChunks::StorageChunks(const std::string & path_, const std::string & name_, const std::string & database_name_, NamesAndTypesListPtr columns_, Context & context_, bool attach) - : StorageLog(path_, name_, columns_), database_name(database_name_), index_loaded(false), reference_counter(path_ + escapeForFileName(name_) + "/refcount.txt"), context(context_) + : StorageLog(path_, name_, columns_), database_name(database_name_), index_loaded(false), reference_counter(path_ + escapeForFileName(name_) + "/refcount.txt"), context(context_), log(&Logger::get("StorageChunks")) { if (!attach) reference_counter.add(1, true); @@ -119,6 +119,8 @@ void StorageChunks::appendChunkToIndex(const std::string & chunk_name, size_t ma void StorageChunks::dropThis() { + LOG_TRACE(log, "Table " << name << " will drop itself."); + ASTDropQuery * query = new ASTDropQuery(); ASTPtr query_ptr = query; query->detach = false;