diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 8a85885d989303d1bbae422155ad0b3be82d9ab1..d5bd2c6010c7237eaa85011132d566a056bfa0bc 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -438,13 +438,12 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } } + removeInvalidTable(uidList, tags); int32_t rows = taosArrayGetSize(uidList); if (rows == 0) { goto end; } - // int64_t stt1 = taosGetTimestampUs(); - // qDebug("generate tag meta rows:%d, cost:%ld us", rows, stt1-stt); code = blockDataEnsureCapacity(pResBlock, rows); if (code != TSDB_CODE_SUCCESS) { @@ -452,7 +451,6 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } - // int64_t st = taosGetTimestampUs(); for (int32_t i = 0; i < rows; i++) { int64_t* uid = taosArrayGet(uidList, i); for (int32_t j = 0; j < taosArrayGetSize(pResBlock->pDataBlock); j++) { @@ -467,7 +465,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* #endif } else { void* tag = taosHashGet(tags, uid, sizeof(int64_t)); - ASSERT(tag); + if (tag == NULL) { + continue; + } STagVal tagVal = {0}; tagVal.cid = pColInfo->info.colId; const char* p = metaGetTableTagVal(tag, pColInfo->info.type, &tagVal); @@ -923,14 +923,14 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray* return -1; } - SArray* pTbList = getTableNameList(pList); - int32_t numOfTables = taosArrayGetSize(pTbList); - SHashObj *uHash = NULL; + SArray* pTbList = getTableNameList(pList); + int32_t numOfTables = taosArrayGetSize(pTbList); + SHashObj* uHash = NULL; size_t listlen = taosArrayGetSize(list); // len > 0 means there already have uids if (listlen > 0) { uHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK); for (int i = 0; i < listlen; i++) { - int64_t *uid = taosArrayGet(list, i); + int64_t* uid = taosArrayGet(list, i); taosHashPut(uHash, uid, sizeof(int64_t), &i, sizeof(i)); } } @@ -2011,4 +2011,4 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag) { char* pBuf = NULL; qDebug("%s", dumpBlockData(pBlock, flag, &pBuf)); taosMemoryFree(pBuf); -} \ No newline at end of file +} diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index ae257863757c78585e13ed2d243fc76803e25a1f..4bd829442372305501d1d571bdec910b2182fcfe 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -319,9 +319,9 @@ SArray* taosArrayDup(const SArray* pSrc, __array_item_dup_fn_t fn) { } else { ASSERT(pSrc->elemSize == sizeof(void*)); - for(int32_t i = 0; i < pSrc->size; ++i) { + for (int32_t i = 0; i < pSrc->size; ++i) { void* p = fn(taosArrayGetP(pSrc, i)); - memcpy(((char*)dst->pData )+ i * dst->elemSize, &p, dst->elemSize); + memcpy(((char*)dst->pData) + i * dst->elemSize, &p, dst->elemSize); } }