提交 649905f4 编写于 作者: X Xiaoyu Wang

TD-13747 New SQL model integration

上级 79e4cc0e
......@@ -101,20 +101,29 @@ SNode* nodesMakeNode(ENodeType type) {
return NULL;
}
static EDealRes destroyNode(SNode* pNode, void* pContext) {
switch (nodeType(pNode)) {
static EDealRes destroyNode(SNode** pNode, void* pContext) {
switch (nodeType(*pNode)) {
case QUERY_NODE_VALUE:
tfree(((SValueNode*)pNode)->literal);
tfree(((SValueNode*)(*pNode))->literal);
break;
case QUERY_NODE_LOGIC_CONDITION:
nodesDestroyList(((SLogicConditionNode*)(*pNode))->pParameterList);
break;
case QUERY_NODE_FUNCTION:
nodesDestroyList(((SFunctionNode*)(*pNode))->pParameterList);
break;
case QUERY_NODE_GROUPING_SET:
nodesDestroyList(((SGroupingSetNode*)(*pNode))->pParameterList);
break;
default:
break;
}
tfree(pNode);
tfree(*pNode);
return DEAL_RES_CONTINUE;
}
void nodesDestroyNode(SNode* pNode) {
nodesWalkNodePostOrder(pNode, destroyNode, NULL);
nodesRewriteNodePostOrder(&pNode, destroyNode, NULL);
}
SNodeList* nodesMakeList() {
......@@ -191,9 +200,9 @@ SNode* nodesListGetNode(SNodeList* pList, int32_t index) {
}
void nodesDestroyList(SNodeList* pList) {
SNode* node;
FOREACH(node, pList) {
nodesDestroyNode(node);
SListCell* pNext = pList->pHead;
while (NULL != pNext) {
pNext = nodesListErase(pList, pNext);
}
tfree(pList);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册