提交 5c0fd801 编写于 作者: H Haojun Liao

fix(query): fix memory leak.

上级 05a2eeed
...@@ -847,6 +847,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -847,6 +847,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
return; return;
} }
int8_t* pIndicator = p->pData;
int32_t totalRows = pBlock->info.rows; int32_t totalRows = pBlock->info.rows;
if (status == FILTER_RESULT_ALL_QUALIFIED) { if (status == FILTER_RESULT_ALL_QUALIFIED) {
...@@ -886,7 +887,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -886,7 +887,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE:
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
while (j < totalRows) { while (j < totalRows) {
if (((int8_t*)p->pData)[j] == 0) { if (pIndicator[j] == 0) {
j += 1; j += 1;
continue; continue;
} }
...@@ -897,13 +898,14 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -897,13 +898,14 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
((int64_t*)pDst->pData)[numOfRows] = ((int64_t*)pDst->pData)[j]; ((int64_t*)pDst->pData)[numOfRows] = ((int64_t*)pDst->pData)[j];
} }
numOfRows += 1; numOfRows += 1;
j += 1;
} }
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT:
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_UINT:
while (j < totalRows) { while (j < totalRows) {
if (((int8_t*)p->pData)[j] == 0) { if (pIndicator[j] == 0) {
j += 1; j += 1;
continue; continue;
} }
...@@ -913,12 +915,13 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -913,12 +915,13 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
((int32_t*)pDst->pData)[numOfRows++] = ((int32_t*)pDst->pData)[j]; ((int32_t*)pDst->pData)[numOfRows++] = ((int32_t*)pDst->pData)[j];
} }
numOfRows += 1; numOfRows += 1;
j += 1;
} }
break; break;
case TSDB_DATA_TYPE_SMALLINT: case TSDB_DATA_TYPE_SMALLINT:
case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_USMALLINT:
while (j < totalRows) { while (j < totalRows) {
if (((int8_t*)p->pData)[j] == 0) { if (pIndicator[j] == 0) {
j += 1; j += 1;
continue; continue;
} }
...@@ -928,13 +931,14 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -928,13 +931,14 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
((int16_t*)pDst->pData)[numOfRows++] = ((int16_t*)pDst->pData)[j]; ((int16_t*)pDst->pData)[numOfRows++] = ((int16_t*)pDst->pData)[j];
} }
numOfRows += 1; numOfRows += 1;
j += 1;
} }
break; break;
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_UTINYINT:
while (j < totalRows) { while (j < totalRows) {
if (((int8_t*)p->pData)[j] == 0) { if (pIndicator[j] == 0) {
j += 1; j += 1;
continue; continue;
} }
...@@ -944,6 +948,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ...@@ -944,6 +948,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD
((int8_t*)pDst->pData)[numOfRows] = ((int8_t*)pDst->pData)[j]; ((int8_t*)pDst->pData)[numOfRows] = ((int8_t*)pDst->pData)[j];
} }
numOfRows += 1; numOfRows += 1;
j += 1;
} }
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册