fix listagg bug and skip table not exist when process schema stats
This commit is contained in:
@ -265,6 +265,7 @@ int ObDbmsStats::gather_schema_stats(ObExecContext &ctx, ParamStore ¶ms, ObO
|
|||||||
update_optimizer_gather_stat_info(NULL, &gather_stat);
|
update_optimizer_gather_stat_info(NULL, &gather_stat);
|
||||||
ObOptStatGatherStatList::instance().remove(gather_stat);
|
ObOptStatGatherStatList::instance().remove(gather_stat);
|
||||||
task_info.completed_table_count_ ++;
|
task_info.completed_table_count_ ++;
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
task_info.task_end_time_ = ObTimeUtility::current_time();
|
task_info.task_end_time_ = ObTimeUtility::current_time();
|
||||||
task_info.ret_code_ = ret;
|
task_info.ret_code_ = ret;
|
||||||
@ -986,6 +987,7 @@ int ObDbmsStats::delete_schema_stats(ObExecContext &ctx, ParamStore ¶ms, ObO
|
|||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1460,6 +1462,7 @@ int ObDbmsStats::export_schema_stats(ObExecContext &ctx, ParamStore ¶ms, ObO
|
|||||||
} else {
|
} else {
|
||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1831,6 +1834,7 @@ int ObDbmsStats::import_schema_stats(ObExecContext &ctx, ParamStore ¶ms, ObO
|
|||||||
} else {
|
} else {
|
||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2124,6 +2128,7 @@ int ObDbmsStats::lock_schema_stats(sql::ObExecContext &ctx,
|
|||||||
} else {
|
} else {
|
||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2329,6 +2334,7 @@ int ObDbmsStats::unlock_schema_stats(sql::ObExecContext &ctx,
|
|||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2531,6 +2537,7 @@ int ObDbmsStats::restore_schema_stats(sql::ObExecContext &ctx,
|
|||||||
} else {
|
} else {
|
||||||
tmp_alloc.reset();
|
tmp_alloc.reset();
|
||||||
}
|
}
|
||||||
|
ret = ret == OB_TABLE_NOT_EXIST ? OB_SUCCESS : ret;//skip table not exist in schema stats op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -6874,6 +6874,9 @@ int ObSelectResolver::check_listagg_aggr_param_valid(ObAggFunRawExpr *aggr_expr)
|
|||||||
LOG_WARN("invalid number of arguments", K(ret), KPC(aggr_expr));
|
LOG_WARN("invalid number of arguments", K(ret), KPC(aggr_expr));
|
||||||
} else if (aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)->is_const_expr()) {
|
} else if (aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)->is_const_expr()) {
|
||||||
//do nothing
|
//do nothing
|
||||||
|
} else if (aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)->has_flag(CNT_AGG)) {
|
||||||
|
ret = OB_ERR_ARGUMENT_SHOULD_CONSTANT;
|
||||||
|
LOG_WARN("argument is should be a const expr", K(ret), KPC(aggr_expr));
|
||||||
} else if (OB_FAIL(check_separator_exprs.push_back(aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)))) {
|
} else if (OB_FAIL(check_separator_exprs.push_back(aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)))) {
|
||||||
LOG_WARN("failed to push back", K(ret));
|
LOG_WARN("failed to push back", K(ret));
|
||||||
} else if (get_select_stmt()->get_all_group_by_exprs(all_group_by_exprs)) {
|
} else if (get_select_stmt()->get_all_group_by_exprs(all_group_by_exprs)) {
|
||||||
|
|||||||
@ -2533,16 +2533,10 @@ int ObRawExprDeduceType::visit(ObWinFunRawExpr &expr)
|
|||||||
result_type.set_accuracy(ObAccuracy::MAX_ACCURACY[ObIntType]);
|
result_type.set_accuracy(ObAccuracy::MAX_ACCURACY[ObIntType]);
|
||||||
}
|
}
|
||||||
expr.set_result_type(result_type);
|
expr.set_result_type(result_type);
|
||||||
|
} else if (OB_FAIL(expr.get_agg_expr()->deduce_type(my_session_))) {
|
||||||
|
LOG_WARN("deduce type failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
// agg函数func_params也为空,此时需要置成agg的result_type
|
expr.set_result_type(expr.get_agg_expr()->get_result_type());
|
||||||
if (expr.get_agg_expr()->get_result_type().is_invalid()) {
|
|
||||||
if (OB_FAIL(expr.get_agg_expr()->deduce_type(my_session_))) {
|
|
||||||
LOG_WARN("deduce type failed", K(ret));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (OB_SUCC(ret)) {
|
|
||||||
expr.set_result_type(expr.get_agg_expr()->get_result_type());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//here pl_agg_udf_expr_ in win_expr must be null, defensive check!!!
|
//here pl_agg_udf_expr_ in win_expr must be null, defensive check!!!
|
||||||
} else if (OB_UNLIKELY(expr.get_pl_agg_udf_expr() != NULL)) {
|
} else if (OB_UNLIKELY(expr.get_pl_agg_udf_expr() != NULL)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user