From b4c898197b736e2906a4e37b384bae06057200fc Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 9 Feb 2022 13:16:23 +0800 Subject: [PATCH] [td-11818] opt --- source/libs/executor/src/executorimpl.c | 1 + source/libs/executor/test/executorTests.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 485471fc9e..6da08e8e3c 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -5711,6 +5711,7 @@ void addToDiskbasedBuf(SOrderOperatorInfo* pInfo, jmp_buf env) { assert(size <= getBufPageSize(pInfo->pSortInternalBuf)); blockDataToBuf(pPage->data, p); + releaseResBufPage(pInfo->pSortInternalBuf, pPage); blockDataDestroy(p); start = stop + 1; diff --git a/source/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp index c8db23c429..136b195ecc 100644 --- a/source/libs/executor/test/executorTests.cpp +++ b/source/libs/executor/test/executorTests.cpp @@ -262,7 +262,7 @@ TEST(testCase, external_sort_Test) { int32_t total = 1; -// while(1) { + while(1) { int64_t s = taosGetTimestampUs(); pRes = pOperator->exec(pOperator, &newgroup); @@ -270,16 +270,16 @@ TEST(testCase, external_sort_Test) { printf("---------------elapsed:%ld\n", e - s); if (pRes == NULL) { -// break; + break; } - SColumnInfoData* pCol1 = static_cast(taosArrayGet(pRes->pDataBlock, 0)); - SColumnInfoData* pCol2 = static_cast(taosArrayGet(pRes->pDataBlock, 1)); - for (int32_t i = 0; i < pRes->info.rows; ++i) { - char* p = colDataGet(pCol2, i); +// SColumnInfoData* pCol1 = static_cast(taosArrayGet(pRes->pDataBlock, 0)); +// SColumnInfoData* pCol2 = static_cast(taosArrayGet(pRes->pDataBlock, 1)); +// for (int32_t i = 0; i < pRes->info.rows; ++i) { +// char* p = colDataGet(pCol2, i); // printf("%d: %d, %s\n", total++, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p)); - } -// } +// } + } pOperator->cleanupFn(pOperator->info, 2); tfree(exp); -- GitLab