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_;