From c6b30184198ab7bd4a8cad18756de92158045da2 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 24 Oct 2020 10:14:46 +0800 Subject: [PATCH] [td-1373] --- src/query/src/qExecutor.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 6291ef53f5..2aca661a6a 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4771,7 +4771,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) { STSElem elem = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pRuntimeEnv->pCtx[0].tag); // failed to find data with the specified tag value and vnodeId if (elem.vnode < 0) { - qDebug("QInfo:%p failed to find tag:%s in ts_comp", pQInfo, pRuntimeEnv->pCtx[0].tag.pz); + qError("QInfo:%p failed to find tag:%s in ts_comp", pQInfo, pRuntimeEnv->pCtx[0].tag.pz); return false; } else { STSCursor cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); @@ -4781,9 +4781,16 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) { } else { STSElem elem = tsBufGetElem(pRuntimeEnv->pTSBuf); if (tVariantCompare(&elem.tag, &pRuntimeEnv->pCtx[0].tag) != 0) { + STSElem elem1 = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pRuntimeEnv->pCtx[0].tag); + // failed to find data with the specified tag value and vnodeId if (elem1.vnode < 0) { + qError("QInfo:%p failed to find tag:%s in ts_comp", pQInfo, pRuntimeEnv->pCtx[0].tag.pz); return false; + } else { + STSCursor cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); + qDebug("QInfo:%p find tag:%s start pos in ts_comp, blockIndex:%d, tsIndex:%d", pQInfo, pRuntimeEnv->pCtx[0].tag.pz, + cur.blockIndex, cur.tsIndex); } } else { tsBufSetCursor(pRuntimeEnv->pTSBuf, &pRuntimeEnv->cur); @@ -5047,6 +5054,10 @@ static void sequentialTableProcess(SQInfo *pQInfo) { break; } + if (pRuntimeEnv->pTSBuf != NULL) { + pRuntimeEnv->cur = pRuntimeEnv->pTSBuf->cur; + } + } else { // all data in the result buffer are skipped due to the offset, continue to retrieve data from current meter if (pQuery->rec.rows == 0) { -- GitLab