diff --git a/include/libs/function/function.h b/include/libs/function/function.h index 7d977b0d235b91e41b8d68d4187068ce47e5ac12..6141829a3f909d798d98cabf84b7e8b759326aba 100644 --- a/include/libs/function/function.h +++ b/include/libs/function/function.h @@ -222,13 +222,6 @@ enum { typedef struct tExprNode { int32_t nodeType; union { -// struct { -// int32_t optr; // binary operator -// void *info; // support filter operation on this expression only available for leaf node -// struct tExprNode *pLeft; // left child pointer -// struct tExprNode *pRight; // right child pointer -// } _node; - SSchema *pSchema;// column node struct SVariant *pVal; // value node diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index b84732c8489a4876e4cabc8a21f211f5fc45e70e..130cebf0b1c97c914b29796e752afb23b78ba653 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -115,6 +115,7 @@ void tsdbResetReadHandle(tsdbReaderT queryHandle, SQueryTableDataCond *pCond) void tsdbDestroyTableGroup(STableGroupInfo *pGroupList); int32_t tsdbGetOneTableGroup(void *pMeta, uint64_t uid, TSKEY startKey, STableGroupInfo *pGroupInfo); int32_t tsdbGetTableGroupFromIdList(SVnode *pVnode, SArray *pTableIdList, STableGroupInfo *pGroupInfo); +void tsdbCleanupReadHandle(tsdbReaderT queryHandle); // tq diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index c9305f6af93d9b5fb473c090b12b714aa94779fb..102c40337d7dd20c2eb4bdb6bbfef3a112414814 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -99,7 +99,6 @@ int32_t tsdbInitSma(STsdb *pTsdb); int32_t tsdbDropTSma(STsdb *pTsdb, char *pMsg); int32_t tsdbDropTSmaData(STsdb *pTsdb, int64_t indexUid); int32_t tsdbInsertRSmaData(STsdb *pTsdb, char *msg); -void tsdbCleanupReadHandle(tsdbReaderT queryHandle); typedef enum { TSDB_FILE_HEAD = 0, // .head TSDB_FILE_DATA, // .data diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index b3d915ab93b63fe3fc1831a43416caa737bf14cc..b39714c1218d9dff0c0184d946b140a975c5bc14 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -390,6 +390,16 @@ SInterval extractIntervalInfo(const STableScanPhysiNode* pTableScanNode) { return interval; } +static void destroyTableScanOperatorInfo(void* param, int32_t numOfOutput) { + STableScanInfo* pTableScanInfo = (STableScanInfo*)param; + taosMemoryFree(pTableScanInfo->pResBlock); + tsdbCleanupReadHandle(pTableScanInfo->dataReader); + + if (pTableScanInfo->pColMatchInfo != NULL) { + taosArrayDestroy(pTableScanInfo->pColMatchInfo); + } +} + SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, tsdbReaderT pDataReader, SReadHandle* readHandle, SExecTaskInfo* pTaskInfo) { STableScanInfo* pInfo = taosMemoryCalloc(1, sizeof(STableScanInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); @@ -436,7 +446,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, pOperator->numOfExprs = numOfCols; pOperator->pTaskInfo = pTaskInfo; - pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doTableScan, NULL, NULL, NULL, NULL, NULL, NULL); + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doTableScan, NULL, NULL, destroyTableScanOperatorInfo, NULL, NULL, NULL); static int32_t cost = 0; diff --git a/source/libs/function/src/texpr.c b/source/libs/function/src/texpr.c index 83e41b199ea2d3f9f1f241fd3e739917816ae309..b91af2d1577fc994ccaa6b11b8e9044ffb88b594 100644 --- a/source/libs/function/src/texpr.c +++ b/source/libs/function/src/texpr.c @@ -27,19 +27,6 @@ #include "tvariant.h" #include "tdef.h" -//static uint8_t UNUSED_FUNC isQueryOnPrimaryKey(const char *primaryColumnName, const tExprNode *pLeft, const tExprNode *pRight) { -// if (pLeft->nodeType == TEXPR_COL_NODE) { -// // if left node is the primary column,return true -// return (strcmp(primaryColumnName, pLeft->pSchema->name) == 0) ? 1 : 0; -// } else { -// // if any children have query on primary key, their parents are also keep this value -// return ((pLeft->nodeType == TEXPR_BINARYEXPR_NODE && pLeft->_node.hasPK == 1) || -// (pRight->nodeType == TEXPR_BINARYEXPR_NODE && pRight->_node.hasPK == 1)) == true -// ? 1 -// : 0; -// } -//} - static void doExprTreeDestroy(tExprNode **pExpr, void (*fp)(void *)); void tExprTreeDestroy(tExprNode *pNode, void (*fp)(void *)) {