[td-1373]

This commit is contained in:
Haojun Liao 2020-10-24 10:14:46 +08:00
parent efc9c32edd
commit c6b3018419
1 changed files with 12 additions and 1 deletions

View File

@ -4771,7 +4771,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
STSElem elem = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pRuntimeEnv->pCtx[0].tag); STSElem elem = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pRuntimeEnv->pCtx[0].tag);
// failed to find data with the specified tag value and vnodeId // failed to find data with the specified tag value and vnodeId
if (elem.vnode < 0) { 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; return false;
} else { } else {
STSCursor cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); STSCursor cur = tsBufGetCursor(pRuntimeEnv->pTSBuf);
@ -4781,9 +4781,16 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
} else { } else {
STSElem elem = tsBufGetElem(pRuntimeEnv->pTSBuf); STSElem elem = tsBufGetElem(pRuntimeEnv->pTSBuf);
if (tVariantCompare(&elem.tag, &pRuntimeEnv->pCtx[0].tag) != 0) { if (tVariantCompare(&elem.tag, &pRuntimeEnv->pCtx[0].tag) != 0) {
STSElem elem1 = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pRuntimeEnv->pCtx[0].tag); 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) { if (elem1.vnode < 0) {
qError("QInfo:%p failed to find tag:%s in ts_comp", pQInfo, pRuntimeEnv->pCtx[0].tag.pz);
return false; 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 { } else {
tsBufSetCursor(pRuntimeEnv->pTSBuf, &pRuntimeEnv->cur); tsBufSetCursor(pRuntimeEnv->pTSBuf, &pRuntimeEnv->cur);
@ -5047,6 +5054,10 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
break; break;
} }
if (pRuntimeEnv->pTSBuf != NULL) {
pRuntimeEnv->cur = pRuntimeEnv->pTSBuf->cur;
}
} else { } else {
// all data in the result buffer are skipped due to the offset, continue to retrieve data from current meter // all data in the result buffer are skipped due to the offset, continue to retrieve data from current meter
if (pQuery->rec.rows == 0) { if (pQuery->rec.rows == 0) {