Merge pull request #9988 from taosdata/bugfix/3.0_memleak
Bugfix/3.0 memleak
This commit is contained in:
commit
357783eb19
|
@ -215,6 +215,8 @@ int32_t getPlan(SRequestObj* pRequest, SQueryNode* pQueryNode, SQueryDag** pDag,
|
||||||
if (pQueryNode->type == TSDB_SQL_SELECT) {
|
if (pQueryNode->type == TSDB_SQL_SELECT) {
|
||||||
setResSchemaInfo(&pRequest->body.resInfo, pSchema, numOfCols);
|
setResSchemaInfo(&pRequest->body.resInfo, pSchema, numOfCols);
|
||||||
pRequest->type = TDMT_VND_QUERY;
|
pRequest->type = TDMT_VND_QUERY;
|
||||||
|
} else {
|
||||||
|
tfree(pSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -237,6 +239,8 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryDag* pDag, SArray* pNodeList)
|
||||||
if (TSDB_SQL_INSERT == pRequest->type || TSDB_SQL_CREATE_TABLE == pRequest->type) {
|
if (TSDB_SQL_INSERT == pRequest->type || TSDB_SQL_CREATE_TABLE == pRequest->type) {
|
||||||
SQueryResult res = {.code = 0, .numOfRows = 0, .msgSize = ERROR_MSG_BUF_DEFAULT_SIZE, .msg = pRequest->msgBuf};
|
SQueryResult res = {.code = 0, .numOfRows = 0, .msgSize = ERROR_MSG_BUF_DEFAULT_SIZE, .msg = pRequest->msgBuf};
|
||||||
|
|
||||||
|
taosArrayDestroy(pNodeList);
|
||||||
|
|
||||||
int32_t code = schedulerExecJob(pRequest->pTscObj->pAppInfo->pTransporter, NULL, pDag, &pRequest->body.pQueryJob, &res);
|
int32_t code = schedulerExecJob(pRequest->pTscObj->pAppInfo->pTransporter, NULL, pDag, &pRequest->body.pQueryJob, &res);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
// handle error and retry
|
// handle error and retry
|
||||||
|
@ -641,7 +645,6 @@ TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||||
|
|
||||||
SRequestObj *pRequest = NULL;
|
SRequestObj *pRequest = NULL;
|
||||||
SQueryNode *pQueryNode = NULL;
|
SQueryNode *pQueryNode = NULL;
|
||||||
SArray *pNodeList = taosArrayInit(4, sizeof(struct SQueryNodeAddr));
|
|
||||||
|
|
||||||
terrno = TSDB_CODE_SUCCESS;
|
terrno = TSDB_CODE_SUCCESS;
|
||||||
CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return);
|
CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return);
|
||||||
|
@ -650,6 +653,8 @@ TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||||
if (qIsDdlQuery(pQueryNode)) {
|
if (qIsDdlQuery(pQueryNode)) {
|
||||||
CHECK_CODE_GOTO(execDdlQuery(pRequest, pQueryNode), _return);
|
CHECK_CODE_GOTO(execDdlQuery(pRequest, pQueryNode), _return);
|
||||||
} else {
|
} else {
|
||||||
|
SArray *pNodeList = taosArrayInit(4, sizeof(struct SQueryNodeAddr));
|
||||||
|
|
||||||
CHECK_CODE_GOTO(getPlan(pRequest, pQueryNode, &pRequest->body.pDag, pNodeList), _return);
|
CHECK_CODE_GOTO(getPlan(pRequest, pQueryNode, &pRequest->body.pDag, pNodeList), _return);
|
||||||
CHECK_CODE_GOTO(scheduleQuery(pRequest, pRequest->body.pDag, pNodeList), _return);
|
CHECK_CODE_GOTO(scheduleQuery(pRequest, pRequest->body.pDag, pNodeList), _return);
|
||||||
pRequest->code = terrno;
|
pRequest->code = terrno;
|
||||||
|
|
Loading…
Reference in New Issue