From 2e0b4236e338f420b6b729967b1338b60efc392e Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 17 Jul 2023 14:45:45 +0800 Subject: [PATCH] fix: hash join row index issue --- source/libs/executor/src/hashjoinoperator.c | 7 ++----- source/libs/executor/src/scanoperator.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/libs/executor/src/hashjoinoperator.c b/source/libs/executor/src/hashjoinoperator.c index 9014f3683e..2feaa88aec 100755 --- a/source/libs/executor/src/hashjoinoperator.c +++ b/source/libs/executor/src/hashjoinoperator.c @@ -369,9 +369,6 @@ static FORCE_INLINE void appendHJoinResToBlock(struct SOperatorInfo* pOperator, pRes->info.rows = resNum; pCtx->rowRemains = pCtx->pBuildRow ? true : false; - if (!pCtx->rowRemains) { - pCtx->probeIdx++; - } } @@ -423,8 +420,8 @@ static void doHashJoinImpl(struct SOperatorInfo* pOperator) { } } - for (int32_t i = pCtx->probeIdx; i < pCtx->pProbeData->info.rows; ++i) { - copyKeyColsDataToBuf(pProbe, i, &bufLen); + for (; pCtx->probeIdx < pCtx->pProbeData->info.rows; ++pCtx->probeIdx) { + copyKeyColsDataToBuf(pProbe, pCtx->probeIdx, &bufLen); SGroupData* pGroup = tSimpleHashGet(pJoin->pKeyHash, pProbe->keyData, bufLen); if (pGroup) { pCtx->pBuildRow = pGroup->rows; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 42ca38897f..b967b317f6 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -797,7 +797,7 @@ static int32_t createTableListInfoFromParam(SOperatorInfo* pOperator) { return TSDB_CODE_INVALID_PARA; } - qDebug("add total %d dynamic tables to scan, exist num:%d", num, taosArrayGetSize(pListInfo->pTableList)); + qDebug("add total %d dynamic tables to scan, exist num:%" PRId64, num, (int64_t)taosArrayGetSize(pListInfo->pTableList)); pListInfo->oneTableForEachGroup = true;