fix set parititon range bug in dynamic sample

This commit is contained in:
sdc
2023-07-27 07:24:16 +00:00
committed by ob-robot
parent 119ef1a196
commit 344f4fb653

View File

@ -336,15 +336,20 @@ int ObStatCollectorOp::split_partition_range()
} }
} }
} }
if (OB_SUCC(ret) && OB_LIKELY(datum_len_sum > 0)) { if (OB_SUCC(ret)) {
void *buf = NULL; void *buf = NULL;
if (OB_LIKELY(datum_len_sum > 0)) {
if (OB_ISNULL(ctx_.get_sqc_handler())) { if (OB_ISNULL(ctx_.get_sqc_handler())) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("sqc handler is null", K(ret)); LOG_WARN("sqc handler is null", K(ret));
} else if (OB_ISNULL(buf = ctx_.get_sqc_handler()->get_safe_allocator().alloc(datum_len_sum))) { } else if (OB_ISNULL(buf = ctx_.get_sqc_handler()->get_safe_allocator().alloc(datum_len_sum))) {
ret = OB_ALLOCATE_MEMORY_FAILED; ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("allocate memory failed", K(ret), K(datum_len_sum)); LOG_WARN("allocate memory failed", K(ret), K(datum_len_sum));
} else { }
}
if (OB_SUCC(ret) && OB_FAIL(ctx_.set_partition_ranges(tmp_part_ranges,
static_cast<char*>(buf), datum_len_sum))) {
LOG_WARN("set partition ranges failed", K(ret));
} }
} }
} }