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

[CP] Fix ctas unknown cast type

上级 90f07cba
......@@ -360,6 +360,10 @@ int ObExprCast::calc_result_type2(
ObAccuracy acc = ObAccuracy::DDL_DEFAULT_ACCURACY2[compatibility_mode][dst_type.get_type()];
type.set_accuracy(acc);
type1.set_accuracy(acc);
} else if (ObYearType == dst_type.get_type()) {
ObAccuracy acc = ObAccuracy::DDL_DEFAULT_ACCURACY2[compatibility_mode][dst_type.get_type()];
type.set_accuracy(acc);
type1.set_accuracy(acc);
} else {
type.set_precision(dst_type.get_precision());
}
......
......@@ -2328,6 +2328,15 @@ int ObRawExprPrinter::print_cast_type(ObRawExpr* expr)
DATA_PRINTF("date");
break;
}
case T_YEAR: {
int16_t scale = parse_node.int16_values_[OB_NODE_CAST_N_SCALE_IDX];
if (scale >= 0) {
DATA_PRINTF("year(%d)", scale);
} else {
DATA_PRINTF("year");
}
break;
}
case T_TIME: {
int16_t scale = parse_node.int16_values_[OB_NODE_CAST_N_SCALE_IDX];
if (scale >= 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册