From 73b7cf5df4578adc41525c1958dd3f683ae1f841 Mon Sep 17 00:00:00 2001 From: yah01 Date: Tue, 20 Jun 2023 16:38:41 +0800 Subject: [PATCH] Fix bool unary expression sometimes returns no data (#25016) Signed-off-by: yah01 --- internal/core/src/query/visitors/ExecExprVisitor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/core/src/query/visitors/ExecExprVisitor.cpp b/internal/core/src/query/visitors/ExecExprVisitor.cpp index b02009fe6b..aa9503f4c6 100644 --- a/internal/core/src/query/visitors/ExecExprVisitor.cpp +++ b/internal/core/src/query/visitors/ExecExprVisitor.cpp @@ -431,7 +431,10 @@ template auto ExecExprVisitor::ExecUnaryRangeVisitorDispatcher(UnaryRangeExpr& expr_raw) -> BitsetType { - if constexpr (std::is_integral_v) { + // bool type is integral but will never be overflowed, + // the check method may evaluate it out of range with bool type, + // exclude bool type here + if constexpr (std::is_integral_v && !std::is_same_v) { auto& expr = static_cast&>(expr_raw); auto val = expr.value_;