Fix ctas unknown cast type
This commit is contained in:
@ -430,6 +430,10 @@ int ObExprCast::calc_result_type2(ObExprResType &type,
|
|||||||
ObAccuracy acc = ObAccuracy::DDL_DEFAULT_ACCURACY2[compatibility_mode][dst_type.get_type()];
|
ObAccuracy acc = ObAccuracy::DDL_DEFAULT_ACCURACY2[compatibility_mode][dst_type.get_type()];
|
||||||
type.set_accuracy(acc);
|
type.set_accuracy(acc);
|
||||||
type1.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 {
|
} else {
|
||||||
type.set_precision(dst_type.get_precision());
|
type.set_precision(dst_type.get_precision());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4006,6 +4006,15 @@ int ObRawExprPrinter::print_cast_type(ObRawExpr *expr)
|
|||||||
DATA_PRINTF("date");
|
DATA_PRINTF("date");
|
||||||
break;
|
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: {
|
case T_TIME: {
|
||||||
int16_t scale = parse_node.int16_values_[OB_NODE_CAST_N_SCALE_IDX];
|
int16_t scale = parse_node.int16_values_[OB_NODE_CAST_N_SCALE_IDX];
|
||||||
if (scale >= 0) {
|
if (scale >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user