fix: request subplan number setting issue

This commit is contained in:
dapan1121 2024-10-25 08:42:14 +08:00
parent 33a0fd5519
commit c31eadea21
1 changed files with 3 additions and 10 deletions

View File

@ -1293,7 +1293,7 @@ void launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void
SQueryPlan* pDag = NULL; SQueryPlan* pDag = NULL;
code = getPlan(pRequest, pQuery, &pDag, pMnodeList); code = getPlan(pRequest, pQuery, &pDag, pMnodeList);
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
subplanNum = pDag->numOfSubplans; pRequest->body.subplanNum = pDag->numOfSubplans;
if (!pRequest->validateOnly) { if (!pRequest->validateOnly) {
SArray* pNodeList = NULL; SArray* pNodeList = NULL;
code = buildSyncExecNodeList(pRequest, &pNodeList, pMnodeList); code = buildSyncExecNodeList(pRequest, &pNodeList, pMnodeList);
@ -1302,10 +1302,6 @@ void launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void
} }
taosArrayDestroy(pNodeList); taosArrayDestroy(pNodeList);
} }
if (TSDB_CODE_SUCCESS == code) {
pRequest->body.subplanNum = subplanNum;
}
} }
taosArrayDestroy(pMnodeList); taosArrayDestroy(pMnodeList);
break; break;
@ -1348,7 +1344,6 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat
pRequest->type = pQuery->msgType; pRequest->type = pQuery->msgType;
SArray* pMnodeList = NULL; SArray* pMnodeList = NULL;
SQueryPlan* pDag = NULL; SQueryPlan* pDag = NULL;
int32_t subplanNum = 0;
int64_t st = taosGetTimestampUs(); int64_t st = taosGetTimestampUs();
if (!pRequest->parseOnly) { if (!pRequest->parseOnly) {
@ -1375,7 +1370,7 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat
tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code), tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
pRequest->requestId); pRequest->requestId);
} else { } else {
subplanNum = pDag->numOfSubplans; pRequest->body.subplanNum = pDag->numOfSubplans;
TSWAP(pRequest->pPostPlan, pDag->pPostPlan); TSWAP(pRequest->pPostPlan, pDag->pPostPlan);
} }
} }
@ -1412,9 +1407,7 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
code = schedulerExecJob(&req, &pRequest->body.queryJob); code = schedulerExecJob(&req, &pRequest->body.queryJob);
} }
if (TSDB_CODE_SUCCESS == code) {
pRequest->body.subplanNum = subplanNum;
}
taosArrayDestroy(pNodeList); taosArrayDestroy(pNodeList);
} else { } else {
qDestroyQueryPlan(pDag); qDestroyQueryPlan(pDag);