From b251e7b35953d913471e21fc66b39dfbfacd2c69 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 6 Aug 2021 23:05:30 +0800 Subject: [PATCH] [td-225]fix bug found by regression test. --- src/client/src/tscProfile.c | 10 ++++++++-- src/inc/taosmsg.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscProfile.c b/src/client/src/tscProfile.c index b75eb5716f..f63e908dc0 100644 --- a/src/client/src/tscProfile.c +++ b/src/client/src/tscProfile.c @@ -18,11 +18,11 @@ #include "tsclient.h" #include "tsocket.h" #include "ttimer.h" -#include "tutil.h" #include "taosmsg.h" #include "tcq.h" #include "taos.h" +#include "tscUtil.h" void tscSaveSlowQueryFp(void *handle, void *tmrId); TAOS *tscSlowQueryConn = NULL; @@ -255,13 +255,19 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) { pQdesc->sqlObjId = htobe64(pSql->self); pQdesc->pid = pHeartbeat->pid; pQdesc->numOfSub = pSql->subState.numOfSub; - pQdesc->stableQuery = pSql->cmd.pQueryInfo->stableQuery; char *p = pQdesc->subSqlInfo; int32_t remainLen = sizeof(pQdesc->subSqlInfo); if (pQdesc->numOfSub == 0) { snprintf(p, remainLen, "N/A"); } else { + SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->cmd); + if (pQueryInfo != NULL) { + pQdesc->stableQuery = (pQueryInfo->stableQuery)?1:0; + } else { + pQdesc->stableQuery = 0; + } + if (pSql->pSubs != NULL && pSql->subState.states != NULL) { for (int32_t i = 0; i < pQdesc->numOfSub; ++i) { SSqlObj *psub = pSql->pSubs[i]; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index c2918cfdf7..2af4e4857a 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -877,7 +877,7 @@ typedef struct { uint64_t sqlObjId; int32_t pid; char fqdn[TSDB_FQDN_LEN]; - bool stableQuery; + uint8_t stableQuery; int32_t numOfSub; char subSqlInfo[TSDB_SHOW_SUBQUERY_LEN]; //include subqueries' index, Obj IDs and states(C-complete/I-imcomplete) } SQueryDesc; -- GitLab