fix 3-stage agg wrong result && fix aggr ignore error code && fix int_cell_str sanity core

This commit is contained in:
obdev
2023-01-10 08:49:25 +00:00
committed by ob-robot
parent eae5622880
commit c1e0bb4522
2 changed files with 5 additions and 3 deletions

View File

@ -363,7 +363,7 @@ int ObMySQLUtil::int_cell_str(
int64_t bytes_to_store_len = get_number_store_len(length); int64_t bytes_to_store_len = get_number_store_len(length);
if (OB_UNLIKELY(pos + bytes_to_store_len + ffi.length() > len)) { if (OB_UNLIKELY(pos + bytes_to_store_len + ffi.length() > len)) {
ret = OB_SIZE_OVERFLOW; ret = OB_SIZE_OVERFLOW;
} else if (zero_cnt > 0 && OB_UNLIKELY(pos + bytes_to_store_len + zero_cnt > len)) { } else if (zero_cnt > 0 && OB_UNLIKELY(pos + bytes_to_store_len + zero_cnt + ffi.length() > len)) {
ret = OB_SIZE_OVERFLOW; ret = OB_SIZE_OVERFLOW;
} else { } else {
MEMCPY(buf + pos + bytes_to_store_len, ffi.ptr(), ffi.length()); MEMCPY(buf + pos + bytes_to_store_len, ffi.ptr(), ffi.length());

View File

@ -1344,7 +1344,7 @@ int ObAggregateProcessor::collect_for_empty_set()
if (OB_ISNULL(aggr_info.expr_)) { if (OB_ISNULL(aggr_info.expr_)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("expr node is null", K(ret)); LOG_WARN("expr node is null", K(ret));
} else if (aggr_info.is_implicit_first_aggr()) { } else if (aggr_info.is_implicit_first_aggr() && aggr_stage_ != ObThreeStageAggrStage::THIRD_STAGE) {
set_expr_datum_null(aggr_info.expr_); set_expr_datum_null(aggr_info.expr_);
} else { } else {
switch (aggr_info.get_expr_type()) { switch (aggr_info.get_expr_type()) {
@ -2297,7 +2297,9 @@ int ObAggregateProcessor::process_aggr_batch_result(
aggr_cell.set_is_evaluated(true); aggr_cell.set_is_evaluated(true);
} }
} }
if (OB_SUCC(ret)) {
ret = approx_count_calc_batch(*llc_bitmap, param_exprs, selector); ret = approx_count_calc_batch(*llc_bitmap, param_exprs, selector);
}
break; break;
} }
case T_FUN_APPROX_COUNT_DISTINCT_SYNOPSIS_MERGE: { case T_FUN_APPROX_COUNT_DISTINCT_SYNOPSIS_MERGE: {