diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 8c3fa254461e2f31a71787606f6378c2f50868b5..d00907f6778d176d1eabe77f92a243a1c5dd3cbd 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -241,6 +241,20 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp continue; } } + if (pHandle->fetchMeta) { + SSubmitBlk* pBlk = pReader->pBlock; + if (pBlk->schemaLen > 0) { + if (pRsp->createTableNum == 0) { + pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); + pRsp->createTableReq = taosArrayInit(0, sizeof(void*)); + } + void* createReq = taosMemoryCalloc(1, pBlk->schemaLen); + memcpy(createReq, pBlk->data, pBlk->schemaLen); + taosArrayPush(pRsp->createTableLen, &pBlk->schemaLen); + taosArrayPush(pRsp->createTableReq, &createReq); + pRsp->createTableNum++; + } + } tqAddBlockDataToRsp(&block, (SMqDataRsp*)pRsp, taosArrayGetSize(block.pDataBlock)); blockDataFreeRes(&block); tqAddBlockSchemaToRsp(pExec, (SMqDataRsp*)pRsp); @@ -261,34 +275,25 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp continue; } } - tqAddBlockDataToRsp(&block, (SMqDataRsp*)pRsp, taosArrayGetSize(block.pDataBlock)); - blockDataFreeRes(&block); - tqAddBlockSchemaToRsp(pExec, (SMqDataRsp*)pRsp); - pRsp->blockNum++; - } -#if 1 - if (pHandle->fetchMeta && pRsp->blockNum) { - SSubmitMsgIter iter = {0}; - tInitSubmitMsgIter(pReq, &iter); - STaosxRsp* pXrsp = (STaosxRsp*)pRsp; - while (1) { - SSubmitBlk* pBlk = NULL; - if (tGetSubmitMsgNext(&iter, &pBlk) < 0) break; - if (pBlk == NULL) break; + if (pHandle->fetchMeta) { + SSubmitBlk* pBlk = pReader->pBlock; if (pBlk->schemaLen > 0) { - if (pXrsp->createTableNum == 0) { - pXrsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); - pXrsp->createTableReq = taosArrayInit(0, sizeof(void*)); + if (pRsp->createTableNum == 0) { + pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); + pRsp->createTableReq = taosArrayInit(0, sizeof(void*)); } void* createReq = taosMemoryCalloc(1, pBlk->schemaLen); memcpy(createReq, pBlk->data, pBlk->schemaLen); - taosArrayPush(pXrsp->createTableLen, &pBlk->schemaLen); - taosArrayPush(pXrsp->createTableReq, &createReq); - pXrsp->createTableNum++; + taosArrayPush(pRsp->createTableLen, &pBlk->schemaLen); + taosArrayPush(pRsp->createTableReq, &createReq); + pRsp->createTableNum++; } } + tqAddBlockDataToRsp(&block, (SMqDataRsp*)pRsp, taosArrayGetSize(block.pDataBlock)); + blockDataFreeRes(&block); + tqAddBlockSchemaToRsp(pExec, (SMqDataRsp*)pRsp); + pRsp->blockNum++; } -#endif } if (pRsp->blockNum == 0) { diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 278f02b2283f0e9ccc037d01f77e5956179a3627..a3e0b2b7334d4ce5333c25c99b4bd9b58e37d0fb 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -811,7 +811,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT } } - // TODO after dropping table, table may be not found + // TODO after dropping table, table may not found ASSERT(found); if (pTableScanInfo->dataReader == NULL) {