提交 c1d0f922 编写于 作者: O obdev 提交者: ob-robot

fix:48260610

上级 0df00274
......@@ -1173,7 +1173,8 @@ int JtFuncHelpler::check_default_value_inner(JtScanCtx* ctx,
LOG_WARN("default value not match returing type", K(ret));
} else if (OB_FAIL(ObJsonExprHelper::pre_default_value_check(col_expr->datum_meta_.type_, in_str, default_expr->datum_meta_.type_))) {
LOG_WARN("default value pre check fail", K(ret), K(in_str));
} else if (OB_FAIL(JtFuncHelpler::check_default_val_accuracy(col_info.data_type_.get_accuracy(), col_expr->datum_meta_.type_, emp_datum))) {
} else if (ob_obj_type_class(col_expr->datum_meta_.type_) == ob_obj_type_class(default_expr->datum_meta_.type_)
&& OB_FAIL(JtFuncHelpler::check_default_val_accuracy(col_info.data_type_.get_accuracy(), default_expr->datum_meta_.type_, emp_datum))) {
LOG_WARN("fail to check accuracy", K(ret));
}
......
......@@ -647,7 +647,7 @@ int ObJsonExprHelper::transform_scalar_2jsonBase(const T &datum,
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("buf allocate failed", K(ret), K(type));
} else {
json_node = (ObJsonDouble *)new(buf)ObJsonDouble(datum.get_double());
json_node = (ObJsonDouble *)new(buf)ObJsonDouble(val);
}
}
break;
......
......@@ -7823,7 +7823,6 @@ int ObDMLResolver::resolve_json_table_column_type(const ParseNode &parse_tree,
common::ObAccuracy accuracy = ObAccuracy::DDL_DEFAULT_ACCURACY2[1][obj_type];
common::ObLengthSemantics length_semantics = parse_tree.length_semantics_;
accuracy.set_length_semantics(length_semantics);
ObObjTypeClass dest_tc = ob_obj_type_class(obj_type);
if (ObStringTC == dest_tc) {
......@@ -7835,7 +7834,7 @@ int ObDMLResolver::resolve_json_table_column_type(const ParseNode &parse_tree,
} else if (ObRawTC == dest_tc) {
accuracy.set_length(parse_tree.int32_values_[1]);
} else if (ObTextTC == dest_tc || ObJsonTC == dest_tc) {
accuracy.set_length(parse_tree.int32_values_[1] < 0 ?
accuracy.set_length(parse_tree.int32_values_[1] <= 0 ?
ObAccuracy::DDL_DEFAULT_ACCURACY[obj_type].get_length() : parse_tree.int32_values_[1]);
} else if (ObIntervalTC == dest_tc) {
if (OB_UNLIKELY(!ObIntervalScaleUtil::scale_check(parse_tree.int16_values_[3]) ||
......@@ -7856,6 +7855,8 @@ int ObDMLResolver::resolve_json_table_column_type(const ParseNode &parse_tree,
accuracy.set_precision(parse_tree.int16_values_[2]);
accuracy.set_scale(parse_tree.int16_values_[3]);
} else if (ObIntType == obj_type) {
data_type.set_int();
accuracy = def_acc;
} else {
accuracy.set_precision(parse_tree.int16_values_[2]);
accuracy.set_scale(parse_tree.int16_values_[3]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册