From 1ae8150f281b9c5a5c20ab45ce1161a7f3fcca0a Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 3 Sep 2019 22:53:59 +0300 Subject: [PATCH] Update Context.cpp --- dbms/src/Interpreters/Context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbms/src/Interpreters/Context.cpp b/dbms/src/Interpreters/Context.cpp index 788b89af40b..43db33ec045 100644 --- a/dbms/src/Interpreters/Context.cpp +++ b/dbms/src/Interpreters/Context.cpp @@ -89,6 +89,7 @@ namespace ErrorCodes extern const int SESSION_NOT_FOUND; extern const int SESSION_IS_LOCKED; extern const int CANNOT_GET_CREATE_TABLE_QUERY; + extern const int LOGICAL_ERROR; } @@ -527,6 +528,9 @@ String Context::getUserFilesPath() const void Context::setSensitiveDataMasker(std::unique_ptr sensitive_data_masker) { + if (!sensitive_data_masker) + throw Exception("Logical error: the 'sensitive_data_masker' is not set", ErrorCodes::LOGICAL_ERROR); + if (sensitive_data_masker->rulesCount() > 0) { auto lock = getLock();