Merge pull request #6603 from taosdata/hotfix/TD-4879
[TD-4879]fix mem leak issue
This commit is contained in:
commit
59d207c87b
|
@ -3604,10 +3604,10 @@ void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGr
|
||||||
|
|
||||||
// todo refactor: filter should not be applied here.
|
// todo refactor: filter should not be applied here.
|
||||||
createFilterInfo(pQueryAttr, 0);
|
createFilterInfo(pQueryAttr, 0);
|
||||||
pQueryAttr->numOfFilterCols = 0;
|
|
||||||
|
|
||||||
SArray* pa = NULL;
|
SArray* pa = NULL;
|
||||||
if (stage == MASTER_SCAN) {
|
if (stage == MASTER_SCAN) {
|
||||||
|
pQueryAttr->createFilterOperator = false; // no need for parent query
|
||||||
pa = createExecOperatorPlan(pQueryAttr);
|
pa = createExecOperatorPlan(pQueryAttr);
|
||||||
} else {
|
} else {
|
||||||
pa = createGlobalMergePlan(pQueryAttr);
|
pa = createGlobalMergePlan(pQueryAttr);
|
||||||
|
|
|
@ -192,6 +192,7 @@ typedef struct SQueryAttr {
|
||||||
bool needReverseScan; // need reverse scan
|
bool needReverseScan; // need reverse scan
|
||||||
bool distinctTag; // distinct tag query
|
bool distinctTag; // distinct tag query
|
||||||
bool stateWindow; // window State on sub/normal table
|
bool stateWindow; // window State on sub/normal table
|
||||||
|
bool createFilterOperator; // if filter operator is needed
|
||||||
int32_t interBufSize; // intermediate buffer sizse
|
int32_t interBufSize; // intermediate buffer sizse
|
||||||
|
|
||||||
int32_t havingNum; // having expr number
|
int32_t havingNum; // having expr number
|
||||||
|
|
|
@ -7045,6 +7045,8 @@ int32_t createFilterInfo(SQueryAttr* pQueryAttr, uint64_t qId) {
|
||||||
doCreateFilterInfo(pQueryAttr->tableCols, pQueryAttr->numOfCols, pQueryAttr->numOfFilterCols,
|
doCreateFilterInfo(pQueryAttr->tableCols, pQueryAttr->numOfCols, pQueryAttr->numOfFilterCols,
|
||||||
&pQueryAttr->pFilterInfo, qId);
|
&pQueryAttr->pFilterInfo, qId);
|
||||||
|
|
||||||
|
pQueryAttr->createFilterOperator = true;
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -623,7 +623,7 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
|
||||||
taosArrayPush(plan, &op);
|
taosArrayPush(plan, &op);
|
||||||
}
|
}
|
||||||
} else { // diff/add/multiply/subtract/division
|
} else { // diff/add/multiply/subtract/division
|
||||||
if (pQueryAttr->numOfFilterCols > 0 && pQueryAttr->vgId == 0) { // todo refactor
|
if (pQueryAttr->numOfFilterCols > 0 && pQueryAttr->createFilterOperator && pQueryAttr->vgId == 0) { // todo refactor
|
||||||
op = OP_Filter;
|
op = OP_Filter;
|
||||||
taosArrayPush(plan, &op);
|
taosArrayPush(plan, &op);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue