diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 328526f17fdbe512a5e592ef792d3fdf724817d3..96aab7e2904cda1a42a83032207c282c2ba7c964 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -3669,7 +3669,7 @@ int WCSPatternMatch(const wchar_t *patterStr, const wchar_t *str, size_t size, c wchar_t accept[3] = {towupper(c), towlower(c), 0}; while (1) { - size_t n = wcsspn(str, accept); + size_t n = wcscspn(str, accept); str += n; if (str[0] == 0 || (n >= size - 1)) { diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 10ea9de835d104a59eadd8328daf907a26ce3c03..08ea7f77ba7f31f53feb5c3ccf6dd950819d7b5b 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -3701,7 +3701,8 @@ int tscGetMetricMeta(SSqlObj *pSql, int32_t clauseIndex) { for (int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { SMeterMetaInfo *pMMInfo = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo, i); - SMeterMeta *pMeterMeta = taosGetDataFromCache(tscCacheHandle, pMMInfo->name); + SMeterMeta *pMeterMeta = (SMeterMeta *)taosGetDataFromExists(tscCacheHandle, pQueryInfo->pMeterInfo[i]->pMeterMeta); + assert(pMeterMeta != NULL); tscAddMeterMetaInfo(pNewQueryInfo, pMMInfo->name, pMeterMeta, NULL, pMMInfo->numOfTags, pMMInfo->tagColumnIndex); } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 77d4a95c145a1556c0e8240e7a5645202f0a0186..1611c5b7240ebbd828ab8ac2126640b377b227c2 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -457,9 +457,11 @@ void tscFreeSqlObjPartial(SSqlObj* pSql) { pCmd->command = 0; // pSql->sqlstr will be used by tscBuildQueryStreamDesc - pthread_mutex_lock(&pObj->mutex); - tfree(pSql->sqlstr); - pthread_mutex_unlock(&pObj->mutex); + if (pObj->signature == pObj) { + pthread_mutex_lock(&pObj->mutex); + tfree(pSql->sqlstr); + pthread_mutex_unlock(&pObj->mutex); + } tscFreeSqlResult(pSql); tfree(pSql->pSubs);