From a901745a032b071ee3f0e1b165643cf242717ef1 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 11 May 2021 20:10:44 +0800 Subject: [PATCH] [td-225] refactor. --- src/client/src/tscSQLParser.c | 8 ++++++++ src/client/src/tscServer.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 39a4ff2239..e2d582515c 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7164,6 +7164,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { int32_t numOfTables = taosArrayGetSize(tableNameList); STableMeta* pTableMeta = calloc(1, maxSize); + SArray* plist = taosArrayInit(4, sizeof(SName)); for(int32_t i = 0; i < numOfTables; ++i) { SName* pname = taosArrayGet(tableNameList, i); tNameExtractFullName(pname, name); @@ -7183,9 +7184,16 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { STableMeta* pMeta = tscTableMetaDup(pTableMeta); taosHashPut(pCmd->pTableMetaMap, name, strlen(name), &pMeta, POINTER_BYTES); + } else {// add to the retrieve table meta array list. + taosArrayPush(plist, pname); } } + // load the table meta for a given table name list + if (taosArrayGetSize(plist) > 0) { + doGetTableMetaFromMnode(); + } + // return getTableMetaFromMnode(pSql, pTableMetaInfo); return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 4e4ed1bcf0..0aae068416 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2411,7 +2411,7 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn } STableMetaInfo *pNewMeterMetaInfo = tscAddEmptyMetaInfo(pNewQueryInfo); - assert(/*pNew->cmd.numOfClause == 1 && */pNewQueryInfo->numOfTables == 1); + assert(pNewQueryInfo->numOfTables == 1); tNameAssign(&pNewMeterMetaInfo->name, &pTableMetaInfo->name); -- GitLab