fix: fix address sanitizer error
This commit is contained in:
parent
edeeb490b1
commit
4ff81b84b0
|
@ -4013,6 +4013,7 @@ static bool findEqCondTbNameInOperatorNode(STranslateContext* pCxt, SNode* pWher
|
||||||
((SRealTableNode*)pTable)->pMeta && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) {
|
((SRealTableNode*)pTable)->pMeta && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) {
|
||||||
pInfo->pRealTable = (SRealTableNode*)pTable;
|
pInfo->pRealTable = (SRealTableNode*)pTable;
|
||||||
taosArrayAddAll(pInfo->aTbnames, aTableNames);
|
taosArrayAddAll(pInfo->aTbnames, aTableNames);
|
||||||
|
taosArrayDestroy(aTableNames);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4072,6 +4073,7 @@ static void findEqualCondTbnameInLogicCondOr(STranslateContext* pCxt, SNode* pWh
|
||||||
info.aTbnames = taosArrayInit(1, sizeof(void*));
|
info.aTbnames = taosArrayInit(1, sizeof(void*));
|
||||||
bool bIsEqTbnameCond = findEqCondTbNameInOperatorNode(pCxt, pTmpNode, &info);
|
bool bIsEqTbnameCond = findEqCondTbNameInOperatorNode(pCxt, pTmpNode, &info);
|
||||||
if (!bIsEqTbnameCond) {
|
if (!bIsEqTbnameCond) {
|
||||||
|
taosArrayDestroy(info.aTbnames);
|
||||||
bAllTbName = false;
|
bAllTbName = false;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
@ -4094,9 +4096,12 @@ static void findEqualCondTbnameInLogicCondOr(STranslateContext* pCxt, SNode* pWh
|
||||||
static int32_t findEqualCondTbname(STranslateContext* pCxt, SNode* pWhere, SArray* aTableTbnames) {
|
static int32_t findEqualCondTbname(STranslateContext* pCxt, SNode* pWhere, SArray* aTableTbnames) {
|
||||||
if (nodeType(pWhere) == QUERY_NODE_OPERATOR) {
|
if (nodeType(pWhere) == QUERY_NODE_OPERATOR) {
|
||||||
SEqCondTbNameTableInfo info = {0};
|
SEqCondTbNameTableInfo info = {0};
|
||||||
|
info.aTbnames = taosArrayInit(1, sizeof(void*));
|
||||||
bool bIsEqTbnameCond = findEqCondTbNameInOperatorNode(pCxt, pWhere, &info);
|
bool bIsEqTbnameCond = findEqCondTbNameInOperatorNode(pCxt, pWhere, &info);
|
||||||
if (bIsEqTbnameCond) {
|
if (bIsEqTbnameCond) {
|
||||||
taosArrayPush(aTableTbnames, &info);
|
taosArrayPush(aTableTbnames, &info);
|
||||||
|
} else {
|
||||||
|
taosArrayDestroy(info.aTbnames);
|
||||||
}
|
}
|
||||||
} else if (nodeType(pWhere) == QUERY_NODE_LOGIC_CONDITION) {
|
} else if (nodeType(pWhere) == QUERY_NODE_LOGIC_CONDITION) {
|
||||||
if (((SLogicConditionNode*)pWhere)->condType == LOGIC_COND_TYPE_AND) {
|
if (((SLogicConditionNode*)pWhere)->condType == LOGIC_COND_TYPE_AND) {
|
||||||
|
|
Loading…
Reference in New Issue