Fix wrong sum_opnsize calculation in aggregate pushdown.

This commit is contained in:
XIAO-HOU
2024-03-27 08:21:21 +00:00
committed by ob-robot
parent faddfeab96
commit 211186fafb

View File

@ -190,11 +190,13 @@ int ObAggRow::init(const ObTableAccessParam &param, const ObTableAccessContext &
if (OB_ISNULL(agg_expr)) { if (OB_ISNULL(agg_expr)) {
ret = OB_INVALID_ARGUMENT; ret = OB_INVALID_ARGUMENT;
LOG_WARN("Unexpected null agg expr", K(ret)); LOG_WARN("Unexpected null agg expr", K(ret));
} else if (T_FUN_COUNT == agg_expr->type_) { } else if (T_FUN_COUNT == agg_expr->type_ || T_FUN_SUM_OPNSIZE == agg_expr->type_) {
if (OB_COUNT_AGG_PD_COLUMN_ID != col_offset) { if (OB_COUNT_AGG_PD_COLUMN_ID != col_offset) {
exclude_null = col_param->is_nullable_for_write(); exclude_null = col_param->is_nullable_for_write();
} }
need_access_data_ = need_access_data_ || exclude_null; // T_FUN_SUM_OPNISZE need_access_data() depends on exclude_null and type,
// so deferred judgment in ObAggRow::check_need_access_data()
need_access_data_ = T_FUN_COUNT == agg_expr->type_ ? (need_access_data_ || exclude_null) : true;
} else { } else {
need_access_data_ = true; need_access_data_ = true;
} }