From 776ce037779fbecfee54d39d659df06ecb22e466 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Mon, 11 May 2020 10:42:47 +0300 Subject: [PATCH] Fixed DateLUTImpl constructors to avoid accidental copying Fixed one case of copying DateLUTImpl --- base/common/DateLUTImpl.h | 7 ++++++- src/DataStreams/TTLBlockInputStream.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/base/common/DateLUTImpl.h b/base/common/DateLUTImpl.h index 6841598b7ca..18078299cd9 100644 --- a/base/common/DateLUTImpl.h +++ b/base/common/DateLUTImpl.h @@ -37,7 +37,12 @@ using YearWeek = std::pair; class DateLUTImpl { public: - DateLUTImpl(const std::string & time_zone); + explicit DateLUTImpl(const std::string & time_zone); + + DateLUTImpl(const DateLUTImpl &) = delete; + DateLUTImpl & operator=(const DateLUTImpl &) = delete; + DateLUTImpl(const DateLUTImpl &&) = delete; + DateLUTImpl & operator=(const DateLUTImpl &&) = delete; public: /// The order of fields matters for alignment and sizeof. diff --git a/src/DataStreams/TTLBlockInputStream.h b/src/DataStreams/TTLBlockInputStream.h index a3c10ec94bf..3896e5232f8 100644 --- a/src/DataStreams/TTLBlockInputStream.h +++ b/src/DataStreams/TTLBlockInputStream.h @@ -45,7 +45,7 @@ private: size_t rows_removed = 0; Logger * log; - DateLUTImpl date_lut; + const DateLUTImpl & date_lut; /// TODO rewrite defaults logic to evaluteMissingDefaults std::unordered_map defaults_result_column;