From 9b01458bd9345b8b05e4a23f3854f39e608a304f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 1 Jul 2021 16:43:09 +0800 Subject: [PATCH] [td-255]fix the bug in recording the elapsed time. --- cmake/platform.inc | 2 +- src/query/src/qExecutor.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmake/platform.inc b/cmake/platform.inc index 236732e452..bdc54c2384 100755 --- a/cmake/platform.inc +++ b/cmake/platform.inc @@ -157,5 +157,5 @@ ELSEIF (${OSTYPE} MATCHES "Alpine") MESSAGE(STATUS "input osType: Alpine") SET(TD_APLHINE TRUE) ELSE () - MESSAGE(STATUS "input osType unknown: " ${OSTYPE}) + MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE}) ENDIF () diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 5989bd810b..0fc75481a6 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -3847,14 +3847,17 @@ int32_t doFillTimeIntervalGapsInResults(SFillInfo* pFillInfo, SSDataBlock *pOutp } void publishOperatorProfEvent(SOperatorInfo* operatorInfo, EQueryProfEventType eventType) { - SQueryProfEvent event; - event.eventType = eventType; - event.eventTime = taosGetTimestampUs(); + SQueryProfEvent event = {0}; + + event.eventType = eventType; + event.eventTime = taosGetTimestampUs(); event.operatorType = operatorInfo->operatorType; - SQInfo* qInfo = operatorInfo->pRuntimeEnv->qinfo; - if (qInfo->summary.queryProfEvents) { - taosArrayPush(qInfo->summary.queryProfEvents, &event); + if (operatorInfo->pRuntimeEnv) { + SQInfo* pQInfo = operatorInfo->pRuntimeEnv->qinfo; + if (pQInfo->summary.queryProfEvents) { + taosArrayPush(pQInfo->summary.queryProfEvents, &event); + } } } -- GitLab