From 96ca3131b4d1642b3d9954c0bae3dce4bf0a0cec Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 22 Jul 2024 13:19:38 +0000 Subject: [PATCH] Fix sort error invalid idx --- src/sql/engine/sort/ob_sort_op_impl.cpp | 9 +++------ src/sql/engine/sort/ob_sort_vec_op_impl.h | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/sql/engine/sort/ob_sort_op_impl.cpp b/src/sql/engine/sort/ob_sort_op_impl.cpp index b0d04bc4b7..57d5f7b041 100644 --- a/src/sql/engine/sort/ob_sort_op_impl.cpp +++ b/src/sql/engine/sort/ob_sort_op_impl.cpp @@ -1421,12 +1421,9 @@ int ObSortOpImpl::prepare_bucket_array(ArrayType *&buckets, uint64_t bucket_num) SQL_ENG_LOG(WARN, "failed to init bucket", K(ret), K(bucket_num)); } } else { - int64_t max_bucket_cnt = buckets->get_capacity(); - if (max_bucket_cnt < bucket_num) { - buckets->reuse(); - if (OB_FAIL(buckets->init(bucket_num))) { - LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); - } + buckets->reuse(); + if (OB_FAIL(buckets->init(bucket_num))) { + LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); } } return ret; diff --git a/src/sql/engine/sort/ob_sort_vec_op_impl.h b/src/sql/engine/sort/ob_sort_vec_op_impl.h index 7052e67d03..a2d669a30c 100644 --- a/src/sql/engine/sort/ob_sort_vec_op_impl.h +++ b/src/sql/engine/sort/ob_sort_vec_op_impl.h @@ -381,12 +381,9 @@ protected: SQL_ENG_LOG(WARN, "failed to init bucket", K(ret), K(bucket_num)); } } else { - int64_t max_bucket_cnt = buckets->get_capacity(); - if (max_bucket_cnt < bucket_num) { - buckets->reuse(); - if (OB_FAIL(buckets->init(bucket_num))) { - LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); - } + buckets->reuse(); + if (OB_FAIL(buckets->init(bucket_num))) { + LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); } } return ret;