fix error in sort logic
This commit is contained in:
parent
78acaed84e
commit
865a13c1c2
|
@ -411,7 +411,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
|
||||||
|
|
||||||
if (size > pageSize) {
|
if (size > pageSize) {
|
||||||
*stopIndex = j - 1;
|
*stopIndex = j - 1;
|
||||||
ASSERT(*stopIndex > startIndex);
|
ASSERT(*stopIndex >= startIndex);
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,9 +132,9 @@ void tsortDestroySortHandle(SSortHandle* pSortHandle) {
|
||||||
taosMemoryFreeClear(pSortHandle->idStr);
|
taosMemoryFreeClear(pSortHandle->idStr);
|
||||||
blockDataDestroy(pSortHandle->pDataBlock);
|
blockDataDestroy(pSortHandle->pDataBlock);
|
||||||
for (size_t i = 0; i < taosArrayGetSize(pSortHandle->pOrderedSource); i++){
|
for (size_t i = 0; i < taosArrayGetSize(pSortHandle->pOrderedSource); i++){
|
||||||
SExternalMemSource* pSource = taosArrayGet(pSortHandle->pOrderedSource, i);
|
SExternalMemSource** pSource = taosArrayGet(pSortHandle->pOrderedSource, i);
|
||||||
blockDataDestroy(pSource->src.pBlock);
|
blockDataDestroy((*pSource)->src.pBlock);
|
||||||
taosMemoryFreeClear(pSource);
|
taosMemoryFreeClear(*pSource);
|
||||||
}
|
}
|
||||||
taosArrayDestroy(pSortHandle->pOrderedSource);
|
taosArrayDestroy(pSortHandle->pOrderedSource);
|
||||||
taosMemoryFreeClear(pSortHandle);
|
taosMemoryFreeClear(pSortHandle);
|
||||||
|
|
|
@ -91,7 +91,7 @@ SSDataBlock* getSingleColDummyBlock(void* param) {
|
||||||
char strOri[128] = {0};
|
char strOri[128] = {0};
|
||||||
taosRandStr(strOri, size);
|
taosRandStr(strOri, size);
|
||||||
int32_t len = 0;
|
int32_t len = 0;
|
||||||
bool ret = taosMbsToUcs4(strOri, size, (TdUcs4*)varDataVal(str), 128, &len);
|
bool ret = taosMbsToUcs4(strOri, size, (TdUcs4*)varDataVal(str), size * TSDB_NCHAR_SIZE, &len);
|
||||||
if (!ret){
|
if (!ret){
|
||||||
printf("error\n");
|
printf("error\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -321,6 +321,10 @@ TEST(testCase, external_mem_sort_Test) {
|
||||||
char buf[128] = {0};
|
char buf[128] = {0};
|
||||||
memcpy(buf, varDataVal(v), varDataLen(v));
|
memcpy(buf, varDataVal(v), varDataLen(v));
|
||||||
printf("%d: %s\n", row++, buf);
|
printf("%d: %s\n", row++, buf);
|
||||||
|
}else if(pInfo[i].type == TSDB_DATA_TYPE_DOUBLE) {
|
||||||
|
printf("double: %lf\n", *(double*)v);
|
||||||
|
}else if (pInfo[i].type == TSDB_DATA_TYPE_FLOAT) {
|
||||||
|
printf("float: %f\n", *(float*)v);
|
||||||
}else{
|
}else{
|
||||||
int64_t result = 0;
|
int64_t result = 0;
|
||||||
if (!bigendian()){
|
if (!bigendian()){
|
||||||
|
|
Loading…
Reference in New Issue