[FEAT MERGE] Functional_index
This commit is contained in:
@ -38,7 +38,7 @@ ObExprCast::ObExprCast(ObIAllocator &alloc)
|
||||
: ObFuncExprOperator::ObFuncExprOperator(alloc, T_FUN_SYS_CAST,
|
||||
N_CAST,
|
||||
2,
|
||||
NOT_ROW_DIMENSION)
|
||||
NOT_VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION)
|
||||
{
|
||||
extra_serialize_ = 0;
|
||||
disable_operand_auto_cast();
|
||||
@ -806,6 +806,33 @@ int ObExprCast::do_implicit_cast(ObExprCtx &expr_ctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprCast::is_valid_for_generated_column(const ObRawExpr*expr, const common::ObIArray<ObRawExpr *> &exprs, bool &is_valid) const {
|
||||
int ret = OB_SUCCESS;
|
||||
if (exprs.count() != 2) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected param num", K(ret), K(exprs.count()));
|
||||
} else if (OB_ISNULL(exprs.at(0)) || OB_ISNULL(exprs.at(1)) || OB_ISNULL(expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid param", K(ret), K(exprs.at(0)), K(exprs.at(1)));
|
||||
} else {
|
||||
ObObjType src = exprs.at(0)->get_result_type().get_type();
|
||||
ObObjType dst = expr->get_result_type().get_type();
|
||||
is_valid = true;
|
||||
if (is_oracle_mode()) {
|
||||
if ((ob_is_oracle_temporal_type(src) && ob_is_string_type(dst))
|
||||
|| (ob_is_oracle_temporal_type(dst) && ob_is_string_type(src))) {
|
||||
is_valid = false;
|
||||
} else if ((ob_is_timestamp_tz(dst) || ob_is_timestamp_ltz(dst))
|
||||
&& (ob_is_timestamp_nano(src) || ob_is_datetime(src))) {
|
||||
is_valid = false;
|
||||
}
|
||||
} else if (ObTimeType == src && ObTimeType != dst && ob_is_temporal_type(dst)) {
|
||||
is_valid = false;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
OB_DEF_SERIALIZE(ObExprCast)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user