Merge pull request #12486 from taosdata/feature/3.0_liaohj
fix(query): set the correct row index during generating join results.
This commit is contained in:
commit
a170b3fa9d
|
@ -5500,18 +5500,21 @@ static SSDataBlock* doMergeJoin(struct SOperatorInfo* pOperator) {
|
|||
|
||||
int32_t blockId = pExprInfo->base.pParam[0].pCol->dataBlockId;
|
||||
int32_t slotId = pExprInfo->base.pParam[0].pCol->slotId;
|
||||
int32_t rowIndex = -1;
|
||||
|
||||
SColumnInfoData* pSrc = NULL;
|
||||
if (pJoinInfo->pLeft->info.blockId == blockId) {
|
||||
pSrc = taosArrayGet(pJoinInfo->pLeft->pDataBlock, slotId);
|
||||
rowIndex = pJoinInfo->leftPos;
|
||||
} else {
|
||||
pSrc = taosArrayGet(pJoinInfo->pRight->pDataBlock, slotId);
|
||||
rowIndex = pJoinInfo->rightPos;
|
||||
}
|
||||
|
||||
if (colDataIsNull_s(pSrc, pJoinInfo->leftPos)) {
|
||||
if (colDataIsNull_s(pSrc, rowIndex)) {
|
||||
colDataAppendNULL(pDst, nrows);
|
||||
} else {
|
||||
char* p = colDataGetData(pSrc, pJoinInfo->leftPos);
|
||||
char* p = colDataGetData(pSrc, rowIndex);
|
||||
colDataAppend(pDst, nrows, p, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue