Fix core at do partition sort
This commit is contained in:
@ -1423,11 +1423,10 @@ int ObSortOpImpl::prepare_bucket_array(ArrayType *&buckets, uint64_t bucket_num)
|
|||||||
} else {
|
} else {
|
||||||
int64_t max_bucket_cnt = buckets->get_capacity();
|
int64_t max_bucket_cnt = buckets->get_capacity();
|
||||||
if (max_bucket_cnt < bucket_num) {
|
if (max_bucket_cnt < bucket_num) {
|
||||||
if (OB_FAIL(buckets->reserve(bucket_num))) {
|
|
||||||
LOG_WARN("failed to reserve bucket array", K(ret), K(bucket_num));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
buckets->reuse();
|
buckets->reuse();
|
||||||
|
if (OB_FAIL(buckets->init(bucket_num))) {
|
||||||
|
LOG_WARN("failed to init bucket array", K(ret), K(bucket_num));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@ -1455,6 +1454,7 @@ int ObSortOpImpl::do_partition_sort(common::ObIArray<ObChunkDatumStore::StoredRo
|
|||||||
} else if (OB_FAIL(prepare_bucket_array<BucketNodeArray>(part_hash_nodes_, node_cnt))) {
|
} else if (OB_FAIL(prepare_bucket_array<BucketNodeArray>(part_hash_nodes_, node_cnt))) {
|
||||||
LOG_WARN("failed to create bucket node array", K(ret));
|
LOG_WARN("failed to create bucket node array", K(ret));
|
||||||
} else {
|
} else {
|
||||||
|
buckets_->set_all(nullptr);
|
||||||
max_bucket_cnt_ = bucket_cnt;
|
max_bucket_cnt_ = bucket_cnt;
|
||||||
max_node_cnt_ = node_cnt;
|
max_node_cnt_ = node_cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -383,11 +383,10 @@ protected:
|
|||||||
} else {
|
} else {
|
||||||
int64_t max_bucket_cnt = buckets->get_capacity();
|
int64_t max_bucket_cnt = buckets->get_capacity();
|
||||||
if (max_bucket_cnt < bucket_num) {
|
if (max_bucket_cnt < bucket_num) {
|
||||||
if (OB_FAIL(buckets->reserve(bucket_num))) {
|
|
||||||
LOG_WARN("failed to reserve bucket array", K(ret), K(bucket_num));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
buckets->reuse();
|
buckets->reuse();
|
||||||
|
if (OB_FAIL(buckets->init(bucket_num))) {
|
||||||
|
LOG_WARN("failed to init bucket array", K(ret), K(bucket_num));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -1309,6 +1309,7 @@ int ObSortVecOpImpl<Compare, Store_Row, has_addon>::do_partition_sort(
|
|||||||
} else if (OB_FAIL(prepare_bucket_array<BucketNodeArray>(part_hash_nodes_, node_cnt))) {
|
} else if (OB_FAIL(prepare_bucket_array<BucketNodeArray>(part_hash_nodes_, node_cnt))) {
|
||||||
LOG_WARN("failed to create bucket node array", K(ret));
|
LOG_WARN("failed to create bucket node array", K(ret));
|
||||||
} else {
|
} else {
|
||||||
|
buckets_->set_all(nullptr);
|
||||||
max_bucket_cnt_ = bucket_cnt;
|
max_bucket_cnt_ = bucket_cnt;
|
||||||
max_node_cnt_ = node_cnt;
|
max_node_cnt_ = node_cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user