From 877d7d65e4c5456c01bf60a4915fe1d3f640b5f0 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 8 Sep 2021 21:00:21 +0800 Subject: [PATCH] [TD-6127] one taos driver connect two cluster --- src/client/src/tscParseLineProtocol.c | 2 +- src/client/src/tscSql.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index 3f35c90134..b984f3a117 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -605,10 +605,10 @@ static int32_t retrieveTableMeta(TAOS* taos, char* tableName, STableMeta** pTabl char fullTableName[TSDB_TABLE_FNAME_LEN] = {0}; memset(fullTableName, 0, tListLen(fullTableName)); tNameExtractFullName(&sname, fullTableName); - tscFreeRegisteredSqlObj(pSql); size_t size = 0; taosHashGetCloneExt(UTIL_GET_TABLEMETA(pSql), fullTableName, strlen(fullTableName), NULL, (void**)&tableMeta, &size); + tscFreeRegisteredSqlObj(pSql); } if (tableMeta != NULL) { diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index e3e50e58f8..2c8ef9b764 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -257,6 +257,7 @@ static void asyncConnCallback(void *param, TAOS_RES *tres, int code) { SSqlObj *pSql = (SSqlObj *) tres; assert(pSql != NULL); + pSql->pTscObj->pClusterInfo = (SClusterInfo *)tscAcquireClusterInfo(pSql->pTscObj->clusterId); pSql->fetchFp(pSql->param, tres, code); } @@ -269,7 +270,6 @@ TAOS *taos_connect_a(char *ip, char *user, char *pass, char *db, uint16_t port, } if (taos) *taos = pObj; - pSql->fetchFp = fp; pSql->res.code = tscBuildAndSendRequest(pSql, NULL); tscDebug("%p DB async connection is opening", taos); -- GitLab