fix scalar = vector throw 4016 under oracle mode

This commit is contained in:
obdev 2023-08-14 11:24:38 +00:00 committed by ob-robot
parent a623dd4b20
commit a8b2555f24

View File

@ -865,8 +865,15 @@ int ObRawExprDeduceType::check_expr_param(ObOpRawExpr &expr)
}
} else if (lib::is_oracle_mode()
&& (T_OP_EQ == expr.get_expr_type() || T_OP_NE == expr.get_expr_type())
&& (T_OP_ROW == expr.get_param_expr(0)->get_expr_type())) {
if (1 > expr.get_param_expr(0)->get_param_count()
&& (T_OP_ROW == expr.get_param_expr(0)->get_expr_type() ||
T_OP_ROW == expr.get_param_expr(1)->get_expr_type())) {
if (expr.get_param_expr(0)->get_expr_type() != T_OP_ROW
&& expr.get_param_expr(1)->get_expr_type() == T_OP_ROW) {
// scalar = vector is not allowed
ret = OB_ERR_INVALID_COLUMN_NUM;
LOG_WARN("invalid relational operator", K(ret));
LOG_USER_ERROR(OB_ERR_INVALID_COLUMN_NUM, static_cast<long>(1));
} else if (1 > expr.get_param_expr(0)->get_param_count()
|| T_OP_ROW == expr.get_param_expr(0)->get_param_expr(0)->get_expr_type()
|| T_OP_ROW != expr.get_param_expr(1)->get_expr_type()) {
ret = OB_ERR_INVALID_COLUMN_NUM;