From 098c5c6a0b8d9086f151f6c4df53d28922d1ec1b Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Fri, 15 Nov 2024 06:17:30 +0000 Subject: [PATCH] revert some changes --- src/Analyzer/ConstantNode.h | 13 +------------ .../Passes/LogicalExpressionOptimizerPass.cpp | 4 ++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Analyzer/ConstantNode.h b/src/Analyzer/ConstantNode.h index 0c14a4a376f..63989d73a70 100644 --- a/src/Analyzer/ConstantNode.h +++ b/src/Analyzer/ConstantNode.h @@ -58,18 +58,7 @@ public: { Field out; constant_value.getColumn()->get(0, out); - - const IDataType & to_type = *constant_value.getType(); - - if (out.isNull() && !canContainNull(to_type)) - return out; - - Field converted = tryConvertFieldToType(out, *constant_value.getType()); - - if (!out.isNull() && converted.isNull()) - return out; - - return converted; + return out; } /// Get constant value string representation diff --git a/src/Analyzer/Passes/LogicalExpressionOptimizerPass.cpp b/src/Analyzer/Passes/LogicalExpressionOptimizerPass.cpp index 79890c55b7c..8007c5dab03 100644 --- a/src/Analyzer/Passes/LogicalExpressionOptimizerPass.cpp +++ b/src/Analyzer/Passes/LogicalExpressionOptimizerPass.cpp @@ -121,8 +121,8 @@ bool isBooleanConstant(const QueryTreeNodePtr & node, bool expected_value) if (!constant_node || !constant_node->getResultType()->equals(DataTypeUInt8())) return false; - bool constant_value; - return (constant_node->getValue().tryGet(constant_value) && constant_value == expected_value); + UInt64 constant_value; + return (constant_node->getValue().tryGet(constant_value) && constant_value == expected_value); } /// Returns true if expression consists of only conjunctions of functions with the specified name or true constants