提交 80cd7963 编写于 作者: D dapan1121

fix bug

上级 296902b3
...@@ -2490,6 +2490,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { ...@@ -2490,6 +2490,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) {
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
int32_t numOfRows = 0; int32_t numOfRows = 0;
assert(numOfTables > 0 && tgNumOfCols > 0); assert(numOfTables > 0 && tgNumOfCols > 0);
SQueryFilePos* cur = &pQueryHandle->cur;
while (++pQueryHandle->activeIndex < numOfTables) { while (++pQueryHandle->activeIndex < numOfTables) {
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex); STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex);
...@@ -2517,7 +2518,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { ...@@ -2517,7 +2518,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) {
if (ASCENDING_TRAVERSE(pQueryHandle->order)) { if (ASCENDING_TRAVERSE(pQueryHandle->order)) {
pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes;; pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes;;
} else { } else {
pData = (char*)pColInfo->pData + (pQueryHandle->outputCapacity + numOfRows - 1) * pColInfo->info.bytes; pData = (char*)pColInfo->pData + (pQueryHandle->outputCapacity - numOfRows - 1) * pColInfo->info.bytes;
} }
if (pTable->lastCols[j].bytes > 0) { if (pTable->lastCols[j].bytes > 0) {
...@@ -2567,11 +2568,11 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { ...@@ -2567,11 +2568,11 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) {
continue; continue;
} }
SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, n);
if (ASCENDING_TRAVERSE(pQueryHandle->order)) { if (ASCENDING_TRAVERSE(pQueryHandle->order)) {
pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes;; pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes;;
} else { } else {
pData = (char*)pColInfo->pData + (pQueryHandle->outputCapacity + numOfRows - 1) * pColInfo->info.bytes; pData = (char*)pColInfo->pData + (pQueryHandle->outputCapacity - numOfRows - 1) * pColInfo->info.bytes;
} }
if (n == 0) { if (n == 0) {
...@@ -2595,6 +2596,9 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { ...@@ -2595,6 +2596,9 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) {
} }
if (numOfRows > 0) { if (numOfRows > 0) {
cur->rows = numOfRows;
cur->mixBlock = true;
return true; return true;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册