From d762ec63714c5cc88559fbee788993fb18fe2ffe Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 17 May 2022 17:36:01 +0800 Subject: [PATCH] enh(tmq): adaptive schema --- source/client/inc/clientInt.h | 6 +++++- source/dnode/mnode/impl/src/mndTopic.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index f9d257af98..516b289f08 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -234,6 +234,10 @@ static FORCE_INLINE SReqResultInfo* tmqGetNextResInfo(TAOS_RES* res, bool conver if (msg->rsp.withSchema) { SSchemaWrapper* pSW = (SSchemaWrapper*)taosArrayGetP(msg->rsp.blockSchema, msg->resIter); setResSchemaInfo(&msg->resInfo, pSW->pSchema, pSW->nCols); + taosMemoryFreeClear(msg->resInfo.row); + taosMemoryFreeClear(msg->resInfo.pCol); + taosMemoryFreeClear(msg->resInfo.length); + taosMemoryFreeClear(msg->resInfo.convertBuf); } setQueryResultFromRsp(&msg->resInfo, pRetrieve, convertUcs4); return &msg->resInfo; @@ -310,7 +314,7 @@ void hbMgrInitMqHbRspHandle(); SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, int32_t code, bool keepQuery, void** res); int32_t getQueryPlan(SRequestObj* pRequest, SQuery* pQuery, SArray** pNodeList); int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList, void** res); -int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest); +int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index 2d9681f543..6c57eb714c 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -79,7 +79,7 @@ SSdbRaw *mndTopicActionEncode(SMqTopicObj *pTopic) { } int32_t schemaLen = 0; if (pTopic->schema.nCols) { - taosEncodeSSchemaWrapper(NULL, &pTopic->schema); + schemaLen = taosEncodeSSchemaWrapper(NULL, &pTopic->schema); } int32_t size = sizeof(SMqTopicObj) + physicalPlanLen + pTopic->sqlLen + pTopic->astLen + schemaLen + MND_TOPIC_RESERVE_SIZE; -- GitLab