Merge branch '3.0' of https://github.com/taosdata/TDengine into feat/row_refact
This commit is contained in:
commit
59a83adf40
|
@ -3504,11 +3504,7 @@ static void destroyOperatorInfo(SOperatorInfo* pOperator) {
|
|||
pOperator->numOfDownstream = 0;
|
||||
}
|
||||
|
||||
if (pOperator->exprSupp.pExprInfo != NULL) {
|
||||
destroyExprInfo(pOperator->exprSupp.pExprInfo, pOperator->exprSupp.numOfExprs);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pOperator->exprSupp.pExprInfo);
|
||||
cleanupExprSupp(&pOperator->exprSupp);
|
||||
taosMemoryFreeClear(pOperator);
|
||||
}
|
||||
|
||||
|
@ -3587,6 +3583,25 @@ void initBasicInfo(SOptrBasicInfo* pInfo, SSDataBlock* pBlock) {
|
|||
initResultRowInfo(&pInfo->resultRowInfo);
|
||||
}
|
||||
|
||||
static void* destroySqlFunctionCtx(SqlFunctionCtx* pCtx, int32_t numOfOutput) {
|
||||
if (pCtx == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < numOfOutput; ++i) {
|
||||
for (int32_t j = 0; j < pCtx[i].numOfParams; ++j) {
|
||||
taosVariantDestroy(&pCtx[i].param[j].param);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pCtx[i].subsidiaries.pCtx);
|
||||
taosMemoryFree(pCtx[i].input.pData);
|
||||
taosMemoryFree(pCtx[i].input.pColumnDataAgg);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pCtx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr) {
|
||||
pSup->pExprInfo = pExprInfo;
|
||||
pSup->numOfExprs = numOfExpr;
|
||||
|
@ -3600,6 +3615,16 @@ int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
void cleanupExprSupp(SExprSupp* pSupp) {
|
||||
destroySqlFunctionCtx(pSupp->pCtx, pSupp->numOfExprs);
|
||||
if (pSupp->pExprInfo != NULL) {
|
||||
destroyExprInfo(pSupp->pExprInfo, pSupp->numOfExprs);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pSupp->pExprInfo);
|
||||
taosMemoryFree(pSupp->rowEntryInfoOffset);
|
||||
}
|
||||
|
||||
SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExprInfo, int32_t numOfCols,
|
||||
SSDataBlock* pResultBlock, SNode* pCondition, SExprInfo* pScalarExprInfo,
|
||||
int32_t numOfScalarExpr, SExecTaskInfo* pTaskInfo) {
|
||||
|
@ -3650,25 +3675,6 @@ _error:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void* destroySqlFunctionCtx(SqlFunctionCtx* pCtx, int32_t numOfOutput) {
|
||||
if (pCtx == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < numOfOutput; ++i) {
|
||||
for (int32_t j = 0; j < pCtx[i].numOfParams; ++j) {
|
||||
taosVariantDestroy(&pCtx[i].param[j].param);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pCtx[i].subsidiaries.pCtx);
|
||||
taosMemoryFree(pCtx[i].input.pData);
|
||||
taosMemoryFree(pCtx[i].input.pColumnDataAgg);
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(pCtx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void cleanupBasicInfo(SOptrBasicInfo* pInfo) {
|
||||
assert(pInfo != NULL);
|
||||
cleanupResultRowInfo(&pInfo->resultRowInfo);
|
||||
|
@ -3710,13 +3716,6 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) {
|
|||
taosMemoryFreeClear(param);
|
||||
}
|
||||
|
||||
void cleanupExprSupp(SExprSupp* pSupp) {
|
||||
destroySqlFunctionCtx(pSupp->pCtx, pSupp->numOfExprs);
|
||||
destroyExprInfo(pSupp->pExprInfo, pSupp->numOfExprs);
|
||||
|
||||
taosMemoryFree(pSupp->rowEntryInfoOffset);
|
||||
}
|
||||
|
||||
static void destroyIndefinitOperatorInfo(void* param, int32_t numOfOutput) {
|
||||
SIndefOperatorInfo* pInfo = (SIndefOperatorInfo*)param;
|
||||
cleanupBasicInfo(&pInfo->binfo);
|
||||
|
|
|
@ -578,6 +578,7 @@ static void destroyTableScanOperatorInfo(void* param, int32_t numOfOutput) {
|
|||
taosArrayDestroy(pTableScanInfo->pColMatchInfo);
|
||||
}
|
||||
|
||||
cleanupExprSupp(&pTableScanInfo->pseudoSup);
|
||||
taosMemoryFreeClear(param);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue