提交 f72c9837 编写于 作者: wmmhello's avatar wmmhello

modify test case

上级 865a13c1
...@@ -409,7 +409,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd ...@@ -409,7 +409,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
} }
} }
if (size > pageSize) { if (size > pageSize) { // pageSize must be able to hold one row
*stopIndex = j - 1; *stopIndex = j - 1;
ASSERT(*stopIndex >= startIndex); ASSERT(*stopIndex >= startIndex);
......
...@@ -6155,7 +6155,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSDataBlock* pR ...@@ -6155,7 +6155,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSDataBlock* pR
return NULL; return NULL;
} }
pInfo->bufPageSize = rowSize < 1024 ? 1024 : rowSize*2; pInfo->bufPageSize = rowSize < 1024 ? 1024*2 : rowSize*2; // there are headers, so pageSize = rowSize + header
pInfo->sortBufSize = pInfo->bufPageSize * 16; // TODO dynamic set the available sort buffer pInfo->sortBufSize = pInfo->bufPageSize * 16; // TODO dynamic set the available sort buffer
pInfo->numOfRowsInRes = 1024; pInfo->numOfRowsInRes = 1024;
......
...@@ -287,7 +287,13 @@ TEST(testCase, external_mem_sort_Test) { ...@@ -287,7 +287,13 @@ TEST(testCase, external_mem_sort_Test) {
for (int i = 0; i < 8; i++){ for (int i = 0; i < 8; i++){
SBlockOrderInfo oi = {0}; SBlockOrderInfo oi = {0};
if(pInfo[i].type == TSDB_DATA_TYPE_NCHAR){
oi.order = TSDB_ORDER_DESC;
}else{
oi.order = TSDB_ORDER_ASC; oi.order = TSDB_ORDER_ASC;
}
oi.slotId = 0; oi.slotId = 0;
SArray* orderInfo = taosArrayInit(1, sizeof(SBlockOrderInfo)); SArray* orderInfo = taosArrayInit(1, sizeof(SBlockOrderInfo));
taosArrayPush(orderInfo, &oi); taosArrayPush(orderInfo, &oi);
...@@ -363,15 +369,16 @@ TEST(testCase, ordered_merge_sort_Test) { ...@@ -363,15 +369,16 @@ TEST(testCase, ordered_merge_sort_Test) {
tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock); tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock);
tsortSetComparFp(phandle, docomp); tsortSetComparFp(phandle, docomp);
SGenericSource* p = static_cast<SGenericSource*>(taosMemoryCalloc(10, sizeof(SGenericSource)));
_info* c = static_cast<_info*>(taosMemoryCalloc(10, sizeof(_info)));
for(int32_t i = 0; i < 10; ++i) { for(int32_t i = 0; i < 10; ++i) {
SGenericSource* p = static_cast<SGenericSource*>(taosMemoryCalloc(1, sizeof(SGenericSource))); c[i].count = 1;
_info* c = static_cast<_info*>(taosMemoryCalloc(1, sizeof(_info))); c[i].pageRows = 1000;
c->count = 1; c[i].startVal = i*1000;
c->pageRows = 1000; c[i].type = TSDB_DATA_TYPE_INT;
c->startVal = i*1000;
p[i].param = c;
p->param = c; tsortAddSource(phandle, &p[i]);
tsortAddSource(phandle, p);
} }
int32_t code = tsortOpen(phandle); int32_t code = tsortOpen(phandle);
...@@ -388,8 +395,10 @@ TEST(testCase, ordered_merge_sort_Test) { ...@@ -388,8 +395,10 @@ TEST(testCase, ordered_merge_sort_Test) {
ASSERT_EQ(row++, *(int32_t*) v); ASSERT_EQ(row++, *(int32_t*) v);
} }
taosMemoryFree(p);
taosMemoryFree(c);
tsortDestroySortHandle(phandle); tsortDestroySortHandle(phandle);
taosMemoryFree(pBlock); blockDataDestroy(pBlock);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册