fix mysqltest introduce by fix three-stage bug

This commit is contained in:
ChangerR
2023-02-27 07:44:16 +00:00
committed by ob-robot
parent aadd763b0d
commit 4a20d8a92b

View File

@ -6648,20 +6648,21 @@ int ObLogPlan::init_groupby_helper(const ObIArray<ObRawExpr*> &group_exprs,
int ret = OB_SUCCESS;
ObSQLSessionInfo *session_info = NULL;
ObLogicalOperator *best_plan = NULL;
const ObSelectStmt* stmt = NULL;
const ObDMLStmt* stmt = NULL;
ObSEArray<ObRawExpr*, 4> group_rollup_exprs;
bool push_group = false;
groupby_helper.is_scalar_group_by_ = true;
groupby_helper.force_use_hash_ = get_log_plan_hint().use_hash_aggregate();
groupby_helper.force_use_merge_ = get_log_plan_hint().use_merge_aggregate();
if (OB_FAIL(candidates_.get_best_plan(best_plan))) {
LOG_WARN("failed to get best plan", K(ret));
} else if (OB_ISNULL(best_plan) ||
OB_ISNULL(get_stmt()) ||
OB_UNLIKELY(!get_stmt()->is_select_stmt()) ||
OB_ISNULL(stmt = static_cast<const ObSelectStmt*>(get_stmt()))) {
OB_ISNULL(stmt = get_stmt())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else if (OB_FALSE_IT(groupby_helper.is_scalar_group_by_ = stmt->is_scala_group_by())) {
} else if (stmt->is_select_stmt() &&
OB_FALSE_IT(groupby_helper.is_scalar_group_by_ =
static_cast<const ObSelectStmt*>(stmt)->is_scala_group_by())) {
} else if (OB_FAIL(append(group_rollup_exprs, group_exprs)) ||
OB_FAIL(append(group_rollup_exprs, rollup_exprs))) {
LOG_WARN("failed to append group rollup exprs", K(ret));