diff --git a/src/sql/engine/expr/ob_array_expr_utils.cpp b/src/sql/engine/expr/ob_array_expr_utils.cpp index a759ae6a2d..f1a533bac9 100644 --- a/src/sql/engine/expr/ob_array_expr_utils.cpp +++ b/src/sql/engine/expr/ob_array_expr_utils.cpp @@ -462,6 +462,8 @@ int ObArrayExprUtils::deduce_array_element_type(ObExecContext *exec_ctx, ObExprR bool is_bigint_signed_exsit = false; bool is_all_num_tc = true; bool is_all_same_type = true; + // scale is zero + bool is_all_int_type = true; ObObjType last_type = ObNullType; int64_t elem_idx = 0; for (int64_t i = 0; i < param_num && OB_SUCC(ret); i++) { @@ -472,6 +474,9 @@ int ObArrayExprUtils::deduce_array_element_type(ObExecContext *exec_ctx, ObExprR || types_stack[i].get_type() == ObNumberType || types_stack[i].get_type() == ObUNumberType) { is_decimal_exist = true; + if (types_stack[i].get_scale() != 0) { + is_all_int_type = false; + } } if (!ob_is_numeric_tc(types_stack[i].get_type_class()) && !types_stack[i].is_null()) { is_all_num_tc = false; @@ -531,11 +536,12 @@ int ObArrayExprUtils::deduce_array_element_type(ObExecContext *exec_ctx, ObExprR } } } else if (is_decimal_exist) { - elem_type.meta_.set_double(); + is_all_int_type ? elem_type.meta_.set_int() : elem_type.meta_.set_double(); + ObObjType target_type = is_all_int_type ? ObIntType : ObDoubleType; for (int64_t i = 0; i < param_num; i++) { if (!types_stack[i].is_null()) { - if (types_stack[i].get_type() != ObDoubleType) { - types_stack[i].set_calc_type(ObDoubleType); + if (types_stack[i].get_type() != target_type) { + types_stack[i].set_calc_type(target_type); } } } diff --git a/src/sql/resolver/cmd/ob_variable_set_resolver.cpp b/src/sql/resolver/cmd/ob_variable_set_resolver.cpp index bbc3c2920b..95a5998ce4 100644 --- a/src/sql/resolver/cmd/ob_variable_set_resolver.cpp +++ b/src/sql/resolver/cmd/ob_variable_set_resolver.cpp @@ -150,6 +150,11 @@ int ObVariableSetResolver::resolve(const ParseNode &parse_tree) } else if (T_DEFAULT == set_node->children_[1]->type_) { // set 系统变量 = default var_node.is_set_default_ = true; + } else if (T_FUN_SYS_ARRAY == set_node->children_[1]->type_) { + // set 系统变量 = array type isn't supported + ret = OB_NOT_SUPPORTED; + LOG_WARN("Variable value type is not supported", K(ret), K(set_node->children_[1]->type_)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "Variable value type"); } else if (var_node.is_system_variable_) { ParseNode value_node; if (T_IDENT == set_node->children_[1]->type_) { diff --git a/src/sql/resolver/ddl/ob_create_index_resolver.cpp b/src/sql/resolver/ddl/ob_create_index_resolver.cpp index 2d3b0d3bd2..f83ef2ce72 100644 --- a/src/sql/resolver/ddl/ob_create_index_resolver.cpp +++ b/src/sql/resolver/ddl/ob_create_index_resolver.cpp @@ -199,8 +199,8 @@ int ObCreateIndexResolver::resolve_index_column_node( } else if (OB_NOT_NULL(column_schema = tbl_schema->get_column_schema(sort_item.column_name_))) { if (ob_is_collection_sql_type(column_schema->get_data_type()) && index_keyname_ != INDEX_KEYNAME::VEC_KEY) { ret = OB_NOT_SUPPORTED; - LOG_WARN("not support index create on vector column yet", K(ret)); - LOG_USER_ERROR(OB_NOT_SUPPORTED, "create index on vector column is"); + LOG_WARN("not support index type create on vector or array column yet", K(ret), K(index_keyname_)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "create index on vector or array column is"); } } }