From e2a1ed96214fa8554d2e5d7004039da09e92b6ae Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Thu, 2 May 2024 18:42:47 +0200 Subject: [PATCH] Fix crash --- src/Analyzer/ConstantNode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Analyzer/ConstantNode.cpp b/src/Analyzer/ConstantNode.cpp index c56818901a5..c72a2e08f08 100644 --- a/src/Analyzer/ConstantNode.cpp +++ b/src/Analyzer/ConstantNode.cpp @@ -148,7 +148,9 @@ bool ConstantNode::isEqualImpl(const IQueryTreeNode & rhs, CompareOptions compar { const auto & rhs_typed = assert_cast(rhs); - if (constant_value.getColumn()->compareAt(0, 0, *rhs_typed.constant_value.getColumn(), 1) != 0) + const auto & column = constant_value.getColumn(); + const auto & rhs_column = rhs_typed.constant_value.getColumn(); + if (column->getDataType() != rhs_column->getDataType() || column->compareAt(0, 0, *rhs_column, 1) != 0) return false; return !compare_options.compare_types || constant_value.getType()->equals(*rhs_typed.constant_value.getType());