diff --git a/src/query/src/qast.c b/src/query/src/qast.c index 4524c5b2492d578aad36faae1b690f201ac9398d..6674dc1abafdae5b9ccd71df7395609a551ce6ef 100644 --- a/src/query/src/qast.c +++ b/src/query/src/qast.c @@ -926,7 +926,7 @@ void tSQLBinaryExprTrv(tExprNode *pExprs, int32_t *val, int16_t *ids) { } } -static int32_t exprTreeToBinaryImpl(tExprNode* pExprTree, SBuffer* pBuf) { +static void exprTreeToBinaryImpl(tExprNode* pExprTree, SBuffer* pBuf) { tbufWrite(pBuf, &pExprTree->nodeType, sizeof(pExprTree->nodeType)); if (pExprTree->nodeType == TSQL_NODE_VALUE) { @@ -973,7 +973,7 @@ SBuffer exprTreeToBinary(tExprNode* pExprTree) { return buf; } -static tExprNode* exprTreeFromBinaryImpl(tExprNode** pExprTree, SBuffer* pBuf) { +static void exprTreeFromBinaryImpl(tExprNode** pExprTree, SBuffer* pBuf) { tExprNode* pExpr = calloc(1, sizeof(tExprNode)); tbufReadToBuffer(pBuf, &pExpr->nodeType, sizeof(pExpr->nodeType)); @@ -1014,7 +1014,7 @@ static tExprNode* exprTreeFromBinaryImpl(tExprNode** pExprTree, SBuffer* pBuf) { tExprNode* exprTreeFromBinary(const void* pBuf, size_t size) { SBuffer rbuf = {0}; - int32_t code = tbufBeginRead(&rbuf, pBuf, size); + /*int32_t code =*/ tbufBeginRead(&rbuf, pBuf, size); tExprNode* pExprNode = NULL; exprTreeFromBinaryImpl(&pExprNode, &rbuf); diff --git a/src/util/src/ihash.c b/src/util/src/ihash.c index 6b58d8ef31c3b83c8c0160364abf2ae97132d0f0..e1c7cb0e5897b4492dfa101c359bd8265e70d9ef 100644 --- a/src/util/src/ihash.c +++ b/src/util/src/ihash.c @@ -221,10 +221,9 @@ void taosCleanUpIntHashWithFp(void *handle, void (*fp)(char *)) { void taosVisitIntHashWithFp(void *handle, int (*fp)(char *, void *), void *param) { IHashObj * pObj; IHashNode *pNode, *pNext; - char * pData = NULL; pObj = (IHashObj *)handle; - if (pObj == NULL || pObj->maxSessions <= 0) return NULL; + if (pObj == NULL || pObj->maxSessions <= 0) return; pthread_mutex_lock(&pObj->mutex); @@ -245,11 +244,10 @@ void taosVisitIntHashWithFp(void *handle, int (*fp)(char *, void *), void *param int32_t taosGetIntHashSize(void *handle) { IHashObj * pObj; IHashNode *pNode, *pNext; - char * pData = NULL; int32_t num = 0; pObj = (IHashObj *)handle; - if (pObj == NULL || pObj->maxSessions <= 0) return NULL; + if (pObj == NULL || pObj->maxSessions <= 0) return 0; pthread_mutex_lock(&pObj->mutex); diff --git a/src/vnode/tsdb/src/tsdbRead.c b/src/vnode/tsdb/src/tsdbRead.c index 599d8bd34738d047f2e3331d3a242f08976bf7b9..a62577016048b1faf0c99ba1c000ac75f11e79bd 100644 --- a/src/vnode/tsdb/src/tsdbRead.c +++ b/src/vnode/tsdb/src/tsdbRead.c @@ -444,6 +444,7 @@ static bool doLoadDataFromFileBlock(STsdbQueryHandle *pQueryHandle) { } tsdbLoadDataBlock(pFile, pBlock, 1, pCheckInfo->pDataCols, data); + return true; } static bool loadQualifiedDataFromFileBlock(STsdbQueryHandle *pQueryHandle) { @@ -484,7 +485,7 @@ bool moveToNextBlock(STsdbQueryHandle *pQueryHandle, int32_t step) { (pQueryHandle->cur.slot == pCheckInfo->compIndex[tid].numOfSuperBlocks - 1)) || (step == QUERY_DESC_FORWARD_STEP && (pQueryHandle->cur.slot == 0))) { // temporarily keep the position value, in case of no data qualified when move forwards(backwards) - SQueryFilePos save = pQueryHandle->cur; +// SQueryFilePos save = pQueryHandle->cur; SFileGroup* fgroup = tsdbGetFileGroupNext(&pCheckInfo->fileIter); int32_t fid = -1; @@ -524,6 +525,8 @@ bool moveToNextBlock(STsdbQueryHandle *pQueryHandle, int32_t step) { } else { // data in cache return hasMoreDataInCacheForSingleModel(pQueryHandle); } + + return false; } int vnodeBinarySearchKey(char *pValue, int num, TSKEY key, int order) { @@ -751,8 +754,6 @@ static bool getQualifiedDataBlock(STsdbQueryHandle *pQueryHandle, STableCheckInf break; } - SFile* pFile = &pCheckInfo->pFileGroup->files[TSDB_FILE_TYPE_DATA]; - // no data block in current file, try next if (pCheckInfo->compIndex[tid].numOfSuperBlocks == 0) { dTrace("QInfo:%p no data block in file, fid:%d, tid:%d, try next", pQueryHandle->qinfo, @@ -836,7 +837,7 @@ static bool hasMoreDataInFileForSingleTableModel(STsdbQueryHandle* pHandle) { assert(pHandle->activeIndex == 0 && taosArrayGetSize(pHandle->pTableCheckInfo) == 1); STsdbFileH* pFileHandle = tsdbGetFile(pHandle->pTsdb); - SQueryFilePos* cur = &pHandle->cur; +// SQueryFilePos* cur = &pHandle->cur; STableCheckInfo* pCheckInfo = taosArrayGet(pHandle->pTableCheckInfo, pHandle->activeIndex); @@ -1329,20 +1330,19 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, const char* pCond return TSDB_CODE_SUCCESS; } -// SArray *tsdbQueryTableList(struct STsdbRepo* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len) { SArray *tsdbQueryTableList(tsdb_repo_t* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len) { // no condition, all tables created according to the stable will involved in querying + SArray* result = taosArrayInit(8, POINTER_BYTES); + if (pTagCond == NULL || wcslen(pTagCond) == 0) { return createTableIdArrayList(tsdb, uid); } else { char* str = convertTagQueryStr(pTagCond, len); - SArray* result = taosArrayInit(8, POINTER_BYTES); STable* pSTable = tsdbGetTableByUid(tsdbGetMeta(tsdb), uid); assert(pSTable != NULL); - if (doQueryTableList(pSTable, result, str) == TSDB_CODE_SUCCESS) { - return result; - } + doQueryTableList(pSTable, result, str); + return result; } }