diff --git a/src/client/src/tscProfile.c b/src/client/src/tscProfile.c index b75eb5716fba1f83b638c24c112ef7eb5973ffc5..f63e908dc00fb9e9b1d95a6cc3b4fd4a9eea8d82 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 c2918cfdf7526a4413155a49599dc9e89b043012..2af4e4857a16a7627033215d22499735bbe373cf 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;