Fix functional index bugs

This commit is contained in:
2149
2023-05-22 04:41:42 +00:00
committed by ob-robot
parent 4f762fb2b0
commit 863d7dfd92
8 changed files with 48 additions and 4 deletions

View File

@ -1974,6 +1974,17 @@ int ObRawExprUtils::build_generated_column_expr(const obrpc::ObCreateIndexArg *a
if (OB_SUCC(ret)) {
if (OB_FAIL(expr->formalize(&session_info))) {
LOG_WARN("formalize expr failed", K(ret), KPC(expr));
} else if (ObResolverUtils::CHECK_FOR_FUNCTION_INDEX == check_status ||
ObResolverUtils::CHECK_FOR_GENERATED_COLUMN == check_status) {
if (OB_FAIL(ObRawExprUtils::check_is_valid_generated_col(expr, expr_factory.get_allocator()))) {
if (OB_ERR_ONLY_PURE_FUNC_CANBE_VIRTUAL_COLUMN_EXPRESSION == ret
&& ObResolverUtils::CHECK_FOR_FUNCTION_INDEX == check_status) {
ret = OB_ERR_ONLY_PURE_FUNC_CANBE_INDEXED;
LOG_WARN("sysfunc in expr is not valid for generated column", K(ret), K(*expr));
} else {
LOG_WARN("fail to check if the sysfunc exprs are valid in generated columns", K(ret));
}
}
}
}