Merge pull request #18455 from taosdata/fix/TD-20671
fix: duplicated explain response issue
This commit is contained in:
commit
7b719d5e51
|
@ -127,6 +127,7 @@ typedef struct SQWTaskCtx {
|
||||||
bool queryRsped;
|
bool queryRsped;
|
||||||
bool queryEnd;
|
bool queryEnd;
|
||||||
bool queryContinue;
|
bool queryContinue;
|
||||||
|
bool queryExecDone;
|
||||||
bool queryInQueue;
|
bool queryInQueue;
|
||||||
int32_t rspCode;
|
int32_t rspCode;
|
||||||
int64_t affectedRows; // for insert ...select stmt
|
int64_t affectedRows; // for insert ...select stmt
|
||||||
|
|
|
@ -59,6 +59,8 @@ static void freeItem(void *param) {
|
||||||
int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
|
int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
|
||||||
qTaskInfo_t taskHandle = ctx->taskHandle;
|
qTaskInfo_t taskHandle = ctx->taskHandle;
|
||||||
|
|
||||||
|
ctx->queryExecDone = true;
|
||||||
|
|
||||||
if (TASK_TYPE_TEMP == ctx->taskType && taskHandle) {
|
if (TASK_TYPE_TEMP == ctx->taskType && taskHandle) {
|
||||||
if (ctx->explain) {
|
if (ctx->explain) {
|
||||||
SArray *execInfoList = taosArrayInit(4, sizeof(SExplainExecInfo));
|
SArray *execInfoList = taosArrayInit(4, sizeof(SExplainExecInfo));
|
||||||
|
@ -116,6 +118,14 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
|
||||||
DataSinkHandle sinkHandle = ctx->sinkHandle;
|
DataSinkHandle sinkHandle = ctx->sinkHandle;
|
||||||
SLocalFetch localFetch = {(void *)mgmt, ctx->localExec, qWorkerProcessLocalFetch, ctx->explainRes};
|
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);
|
SArray *pResList = taosArrayInit(4, POINTER_BYTES);
|
||||||
while (true) {
|
while (true) {
|
||||||
QW_TASK_DLOG("start to execTask, loopIdx:%d", i++);
|
QW_TASK_DLOG("start to execTask, loopIdx:%d", i++);
|
||||||
|
|
Loading…
Reference in New Issue