Merge pull request #6629 from taosdata/hotfix/TD-4910
[TD-4910]fix double free issue
This commit is contained in:
commit
0be6a5a4f8
|
@ -7784,6 +7784,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
|
||||||
const char* msg5 = "only tag query not compatible with normal column filter";
|
const char* msg5 = "only tag query not compatible with normal column filter";
|
||||||
const char* msg6 = "not support stddev/percentile/interp in the outer query yet";
|
const char* msg6 = "not support stddev/percentile/interp in the outer query yet";
|
||||||
const char* msg7 = "derivative/twa/irate requires timestamp column exists in subquery";
|
const char* msg7 = "derivative/twa/irate requires timestamp column exists in subquery";
|
||||||
|
const char* msg8 = "condition missing for join query";
|
||||||
|
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
|
@ -7871,6 +7872,10 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
|
||||||
if (validateWhereNode(pQueryInfo, &pSqlNode->pWhere, pSql) != TSDB_CODE_SUCCESS) {
|
if (validateWhereNode(pQueryInfo, &pSqlNode->pWhere, pSql) != TSDB_CODE_SUCCESS) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return TSDB_CODE_TSC_INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (pQueryInfo->numOfTables > 1) {
|
||||||
|
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate the interval info
|
// validate the interval info
|
||||||
|
|
|
@ -1307,7 +1307,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta) {
|
||||||
if (pCmd->pTableMetaMap != NULL) {
|
if (pCmd->pTableMetaMap != NULL) {
|
||||||
STableMetaVgroupInfo* p = taosHashIterate(pCmd->pTableMetaMap, NULL);
|
STableMetaVgroupInfo* p = taosHashIterate(pCmd->pTableMetaMap, NULL);
|
||||||
while (p) {
|
while (p) {
|
||||||
tfree(p->pVgroupInfo);
|
tscVgroupInfoClear(p->pVgroupInfo);
|
||||||
tfree(p->pTableMeta);
|
tfree(p->pTableMeta);
|
||||||
p = taosHashIterate(pCmd->pTableMetaMap, p);
|
p = taosHashIterate(pCmd->pTableMetaMap, p);
|
||||||
}
|
}
|
||||||
|
@ -4082,7 +4082,10 @@ SVgroupsInfo* tscVgroupsInfoDup(SVgroupsInfo* pVgroupsInfo) {
|
||||||
|
|
||||||
size_t size = sizeof(SVgroupInfo) * pVgroupsInfo->numOfVgroups + sizeof(SVgroupsInfo);
|
size_t size = sizeof(SVgroupInfo) * pVgroupsInfo->numOfVgroups + sizeof(SVgroupsInfo);
|
||||||
SVgroupsInfo* pInfo = calloc(1, size);
|
SVgroupsInfo* pInfo = calloc(1, size);
|
||||||
memcpy(pInfo, pVgroupsInfo, size);
|
pInfo->numOfVgroups = pVgroupsInfo->numOfVgroups;
|
||||||
|
for (int32_t m = 0; m < pVgroupsInfo->numOfVgroups; ++m) {
|
||||||
|
tscSVgroupInfoCopy(&pInfo->vgroups[m], &pVgroupsInfo->vgroups[m]);
|
||||||
|
}
|
||||||
return pInfo;
|
return pInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue