diff --git a/src/sql/engine/expr/ob_array_cast.cpp b/src/sql/engine/expr/ob_array_cast.cpp index 01024101f1..65180ae656 100644 --- a/src/sql/engine/expr/ob_array_cast.cpp +++ b/src/sql/engine/expr/ob_array_cast.cpp @@ -392,6 +392,7 @@ int ObArrayCastUtils::add_json_node_to_array(common::ObIAllocator &alloc, ObJson LOG_WARN("not supported", K(ret)); break; } + case ObUFloatType: case ObFloatType: { double val; ObArrayFixedSize *dst_arr = static_cast *>(dst); @@ -404,6 +405,7 @@ int ObArrayCastUtils::add_json_node_to_array(common::ObIAllocator &alloc, ObJson } break; } + case ObUDoubleType: case ObDoubleType: { double val; ObArrayFixedSize *dst_arr = static_cast *>(dst); diff --git a/src/sql/engine/expr/ob_expr_minus.cpp b/src/sql/engine/expr/ob_expr_minus.cpp index 8de26ae3bb..9ac8b35734 100644 --- a/src/sql/engine/expr/ob_expr_minus.cpp +++ b/src/sql/engine/expr/ob_expr_minus.cpp @@ -65,21 +65,13 @@ int ObExprMinus::calc_result_type2(ObExprResType &type, if (type1.is_collection_sql_type() && type2.is_collection_sql_type()) { ObSQLSessionInfo *session = const_cast(type_ctx.get_session()); ObExecContext *exec_ctx = OB_ISNULL(session) ? NULL : session->get_cur_exec_ctx(); - if (type1.get_subschema_id() != type2.get_subschema_id()) { - ObExprResType coll_calc_type = type; - if (OB_FAIL(ObExprResultTypeUtil::get_array_calc_type(exec_ctx, type1, type2, coll_calc_type))) { - LOG_WARN("failed to check array compatibilty", K(ret)); - } else { - type1.set_calc_meta(coll_calc_type); - type2.set_calc_meta(coll_calc_type); - type.set_collection(coll_calc_type.get_subschema_id()); - } + ObExprResType coll_calc_type = type; + if (OB_FAIL(ObExprResultTypeUtil::get_array_calc_type(exec_ctx, type1, type2, coll_calc_type))) { + LOG_WARN("failed to check array compatibilty", K(ret)); } else { - // subschem id in calc_meta is set to uint16_max in ObArithExprOperator::calc_result_type2 - // set real subschema id to calc_meta from meta - type1.set_calc_meta(type1); - type2.set_calc_meta(type2); - type.set_collection(type1.get_subschema_id()); + type1.set_calc_meta(coll_calc_type); + type2.set_calc_meta(coll_calc_type); + type.set_collection(coll_calc_type.get_subschema_id()); } } else { // only support vector/array/varchar - vector/array/varchar now // array and varchar need cast to array(float) diff --git a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp index ba0c979d0c..85c1e986eb 100644 --- a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp @@ -3609,7 +3609,7 @@ int ObRawExprDeduceType::set_array_agg_result_type(ObAggFunRawExpr &expr, ret = OB_ERR_UNEXPECTED; LOG_WARN("internal order expr is null", K(ret)); } else if (order_expr->get_result_type().get_type() == ObCollectionSQLType) { - ret = OB_NOT_SUPPORTED; + ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_WARN("array type used for sorting isn't supported", K(ret)); } }