diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index d2c0a70731..0c4dc1705c 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -874,9 +874,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res) { int32_t code = 0; - pRequest->stmtType = pQuery->pRoot->type; - - if (!pRequest->inRetry) { + if (pQuery->pRoot) { + pRequest->stmtType = pQuery->pRoot->type; + } + + if (pQuery->pRoot && !pRequest->inRetry) { STscObj *pTscObj = pRequest->pTscObj; SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; if (QUERY_NODE_VNODE_MODIF_STMT == pQuery->pRoot->type) { diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 56d09850fc..d860224827 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -420,7 +420,7 @@ static int32_t smlSendMetaMsg(SSmlHandle *info, SName *pName, SSmlSTableMeta *s } tSerializeSMCreateStbReq(pCmdMsg.pMsg, pCmdMsg.msgLen, &pReq); - SQuery pQuery; + SQuery pQuery = {0}; pQuery.execMode = QUERY_EXEC_MODE_RPC; pQuery.pCmdMsg = &pCmdMsg; pQuery.msgType = pQuery.pCmdMsg->msgType;