提交 46e76fc2 编写于 作者: H Haojun Liao

fix(query): fix a corner case for generating the filtered ssdatablock.

上级 234c0cd9
......@@ -2146,6 +2146,8 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR
SSDataBlock* px = createOneDataBlock(pBlock, false);
blockDataEnsureCapacity(px, pBlock->info.rows);
int32_t totalRows = pBlock->info.rows;
for (int32_t i = 0; i < pBlock->info.numOfCols; ++i) {
SColumnInfoData* pDst = taosArrayGet(px->pDataBlock, i);
SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, i);
......@@ -2156,7 +2158,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR
}
int32_t numOfRows = 0;
for (int32_t j = 0; j < pBlock->info.rows; ++j) {
for (int32_t j = 0; j < totalRows; ++j) {
if (rowRes[j] == 0) {
continue;
}
......@@ -2169,7 +2171,12 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR
numOfRows += 1;
}
pBlock->info.rows = numOfRows;
if (pBlock->info.rows == totalRows) {
pBlock->info.rows = numOfRows;
} else {
ASSERT(pBlock->info.rows == numOfRows);
}
*pSrc = *pDst;
}
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册