fix bug case when expr can't do batch_execute optimization

This commit is contained in:
yishenglanlingzui
2023-01-28 20:37:21 +08:00
committed by ob-robot
parent 0f14606391
commit 4bb1033505
3 changed files with 33 additions and 0 deletions

View File

@ -7842,5 +7842,29 @@ int ObRawExprUtils::is_contain_params(const ObRawExpr *expr, bool &is_contain)
return ret;
}
int ObRawExprUtils::check_contain_case_when_exprs(const ObRawExpr *raw_expr, bool &contain)
{
int ret = OB_SUCCESS;
bool is_stack_overflow = false;
if (OB_ISNULL(raw_expr)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("expr passed in is NULL", K(ret));
} else if (OB_FAIL(check_stack_overflow(is_stack_overflow))) {
LOG_WARN("check stack overflow failed", K(ret));
} else if (is_stack_overflow) {
ret = OB_SIZE_OVERFLOW;
LOG_WARN("too deep recursive", K(ret));
} else if (raw_expr->get_expr_type() == T_OP_CASE) {
contain = true;
} else {
for (int64_t i = 0; OB_SUCC(ret) && !contain && i < raw_expr->get_param_count(); i++) {
if (OB_FAIL(SMART_CALL(check_contain_case_when_exprs(raw_expr->get_param_expr(i), contain)))) {
LOG_WARN("failed to replace_ref_column", KPC(raw_expr), K(i));
}
}
}
return ret;
}
}
}

View File

@ -1053,6 +1053,7 @@ public:
const ObSQLSessionInfo &session_info,
const share::schema::ObTableSchema &index_schema,
ObColumnRefRawExpr *&spk_expr);
static int check_contain_case_when_exprs(const ObRawExpr *raw_expr, bool &contain);
private :