diff --git a/src/sql/engine/basic/ob_pushdown_filter.cpp b/src/sql/engine/basic/ob_pushdown_filter.cpp index e1b15a083b..70bcf66541 100644 --- a/src/sql/engine/basic/ob_pushdown_filter.cpp +++ b/src/sql/engine/basic/ob_pushdown_filter.cpp @@ -169,11 +169,12 @@ int ObPushdownFilterConstructor::is_white_mode(const ObRawExpr* raw_expr, bool & ret = OB_ERR_UNEXPECTED; LOG_WARN("Unexpected null child expr", K(ret), K(i)); } else { + const ObObjMeta ¶m_meta = child->get_result_meta(); need_check = child->is_const_expr(); - if (need_check) { - const ObObjMeta ¶m_meta = child->get_result_meta(); - need_check = param_meta.is_null() || - (col_meta.get_type() == param_meta.get_type() && col_meta.get_collation_type() == param_meta.get_collation_type()); + if (need_check && !param_meta.is_null()) { + const ObCmpOp cmp_op = sql::ObRelationalExprOperator::get_cmp_op(raw_expr->get_expr_type()); + obj_cmp_func cmp_func = nullptr; + need_check = ObObjCmpFuncs::can_cmp_without_cast(col_meta, param_meta, cmp_op, cmp_func); } } } diff --git a/src/sql/engine/expr/ob_expr_operator.h b/src/sql/engine/expr/ob_expr_operator.h index 4dbdd5ca49..e6ec41cd8c 100644 --- a/src/sql/engine/expr/ob_expr_operator.h +++ b/src/sql/engine/expr/ob_expr_operator.h @@ -1218,10 +1218,6 @@ public: static int eval_pl_udt_compare(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); -protected: - static bool is_int_cmp_const_str(const ObExprResType *type1, - const ObExprResType *type2, - common::ObObjType &cmp_type); OB_INLINE static common::ObCmpOp get_cmp_op(const ObExprOperatorType type) { /* * maybe we can use associative array(table lookup) to get a better @@ -1278,6 +1274,10 @@ protected: return cmp_op; } +protected: + static bool is_int_cmp_const_str(const ObExprResType *type1, + const ObExprResType *type2, + common::ObObjType &cmp_type); OB_INLINE static bool is_expected_cmp_ret(const common::ObCmpOp cmp_op, const int cmp_ret) {