Merge pull request #18455 from taosdata/fix/TD-20671

fix: duplicated explain response issue
This commit is contained in:
dapan1121 2022-11-25 16:11:49 +08:00 committed by GitHub
commit 7b719d5e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -127,6 +127,7 @@ typedef struct SQWTaskCtx {
bool queryRsped;
bool queryEnd;
bool queryContinue;
bool queryExecDone;
bool queryInQueue;
int32_t rspCode;
int64_t affectedRows; // for insert ...select stmt

View File

@ -59,6 +59,8 @@ static void freeItem(void *param) {
int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
qTaskInfo_t taskHandle = ctx->taskHandle;
ctx->queryExecDone = true;
if (TASK_TYPE_TEMP == ctx->taskType && taskHandle) {
if (ctx->explain) {
SArray *execInfoList = taosArrayInit(4, sizeof(SExplainExecInfo));
@ -116,6 +118,14 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
DataSinkHandle sinkHandle = ctx->sinkHandle;
SLocalFetch localFetch = {(void *)mgmt, ctx->localExec, qWorkerProcessLocalFetch, ctx->explainRes};
if (ctx->queryExecDone) {
if (queryStop) {
*queryStop = true;
}
return TSDB_CODE_SUCCESS;
}
SArray *pResList = taosArrayInit(4, POINTER_BYTES);
while (true) {
QW_TASK_DLOG("start to execTask, loopIdx:%d", i++);