diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 0e1d82b273523a02a40ee0605f7ab259013bfe2a..83714040df50442943f235f330dfeebeb86d7326 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -681,6 +681,8 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList }; int32_t code = schedulerExecJob(&req, &pRequest->body.queryJob); + + destroyQueryExecRes(&pRequest->body.resInfo.execRes); memcpy(&pRequest->body.resInfo.execRes, &res, sizeof(res)); if (code != TSDB_CODE_SUCCESS) { diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index 8b3a2016b80bb1c0f96bc312f2043f370f5b7c54..2cb227d84b1332550c23006a7392f0e7346d2600 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -20,6 +20,7 @@ #include "tmsg.h" #include "tref.h" #include "trpc.h" +#include "tglobal.h" void schFreeTask(SSchJob *pJob, SSchTask *pTask) { schDeregisterTaskHb(pJob, pTask); @@ -870,8 +871,12 @@ int32_t schLaunchTaskImpl(void *param) { SCH_TASK_ELOG("failed to create physical plan, code:%s, msg:%p, len:%d", tstrerror(code), pTask->msg, pTask->msgLen); SCH_ERR_JRET(code); - } else { - SCH_TASK_DLOGL("physical plan len:%d, %s", pTask->msgLen, pTask->msg); + } else if (tsQueryPlannerTrace) { + char *msg = NULL; + int32_t msgLen = 0; + qSubPlanToString(plan, &msg, &msgLen); + SCH_TASK_DLOGL("physical plan len:%d, %s", msgLen, msg); + taosMemoryFree(msg); } }