diff --git a/source/common/src/trow.c b/source/common/src/trow.c index 861b4dc09334beb2d62e7e0677519c448855a38f..db4bc49425e1835f3451bea18049f4488a1c2b42 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -353,10 +353,10 @@ static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, i for (int i = 0; i < src2->numOfCols; i++) { SCellVal sVal = {0}; ASSERT(target->cols[i].type == src2->cols[i].type); - if (src2->cols[i].len > 0 && !isNull(src2->cols[i].pData, src2->cols[i].type)) { - if (tdGetColDataOfRow(&sVal, src1->cols + i, *iter1) < 0) { - TASSERT(0); - } + if (tdGetColDataOfRow(&sVal, src2->cols + i, *iter2) < 0) { + TASSERT(0); + } + if (src2->cols[i].len > 0 && !tdValTypeIsNull(sVal.valType)) { tdAppendValToDataCol(&(target->cols[i]), sVal.valType, sVal.val, target->numOfRows, target->maxPoints); } else if (!forceSetNull && key1 == key2 && src1->cols[i].len > 0) { if (tdGetColDataOfRow(&sVal, src1->cols + i, *iter1) < 0) {