TD-13747 New SQL model integration
This commit is contained in:
parent
79e4cc0ea9
commit
649905f4ee
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue