diff --git a/src/sql/resolver/expr/ob_raw_expr_type_demotion.cpp b/src/sql/resolver/expr/ob_raw_expr_type_demotion.cpp index 2ff75d77f8..7e4e4d7fad 100644 --- a/src/sql/resolver/expr/ob_raw_expr_type_demotion.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_type_demotion.cpp @@ -434,9 +434,8 @@ int ObRawExprTypeDemotion::demote_type_in_or_not_in(ObOpRawExpr &expr) OB_ISNULL(right = expr.get_param_expr(1))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("param expr is null", K(ret), KP(left), KP(right)); - } else if (T_OP_ROW != right->get_expr_type() - || !op_row_params_is_all_const(*static_cast(right))) { - // if in list is not op_row and params is not all const expr, skip type demotion + } else if (T_OP_ROW != right->get_expr_type()) { + // if in list is not op_row, skip type demotion } else if (T_REF_COLUMN == left->get_expr_type()) { // col in (a, b, c) const ObColumnRefRawExpr *column_ref = static_cast(left); @@ -495,24 +494,6 @@ int ObRawExprTypeDemotion::demote_type_in_or_not_in(ObOpRawExpr &expr) return ret; } -// Check whether all parameters in the right child of the IN/NOT_IN expr are constants. No longer -// verify the number and structural validity of the parameters here, as this has already been -// handled in function `ObRawExprDeduceType::check_expr_param`. -bool ObRawExprTypeDemotion::op_row_params_is_all_const(const ObOpRawExpr &op_row) const -{ - bool is_all_const = true; - for (int64_t i = 0; is_all_const && i < op_row.get_param_count(); ++i) { - if (OB_ISNULL(op_row.get_param_expr(i))) { - } else if (T_OP_ROW == op_row.get_param_expr(i)->get_expr_type()) { - const ObOpRawExpr *child_op_row = static_cast(op_row.get_param_expr(i)); - is_all_const = op_row_params_is_all_const(*child_op_row); - } else { - is_all_const = op_row.get_param_expr(i)->is_static_const_expr(); - } - } - return is_all_const; -} - // Since plans are stored in the plan cache, for comparisons that require type demotion, // we need to add range placement constraints. When the range placement derived from constant // analysis differs, different comparison types will be selected. diff --git a/src/sql/resolver/expr/ob_raw_expr_type_demotion.h b/src/sql/resolver/expr/ob_raw_expr_type_demotion.h index 552b93ffaa..77ba32b6d9 100644 --- a/src/sql/resolver/expr/ob_raw_expr_type_demotion.h +++ b/src/sql/resolver/expr/ob_raw_expr_type_demotion.h @@ -65,7 +65,6 @@ private: ObOpRawExpr &op_expr, int64_t replaced_expr_idx); int demote_type_in_or_not_in(ObOpRawExpr &expr); - bool op_row_params_is_all_const(const ObOpRawExpr &op_row) const; int add_range_placement_constraint(const ObColumnRefRawExpr &column_ref, const ObConstRawExpr &const_expr, const RangePlacement rp);