diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index d8999a0b6fece9cda4d5c8e2af82e65afa4ed580..55afd4c62096974e379e78d448086f10e9860764 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -624,8 +624,9 @@ static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, i if ((key1 > key2) || (key1 == key2 && !TKEY_IS_DELETED(tkey2))) { for (int i = 0; i < src2->numOfCols; i++) { ASSERT(target->cols[i].type == src2->cols[i].type); - if (src2->cols[i].len > 0 && !isNull(src2->cols[i].pData, src2->cols[i].type)) { - dataColAppendVal(&(target->cols[i]), tdGetColDataOfRow(src2->cols + i, *iter2), target->numOfRows, + const void *src2Val = tdGetColDataOfRow(src2->cols + i, *iter2); + if (src2->cols[i].len > 0 && !isNull(src2Val, src2->cols[i].type)) { + dataColAppendVal(&(target->cols[i]), src2Val, target->numOfRows, target->maxPoints, 0); } else if(!forceSetNull && key1 == key2 && src1->cols[i].len > 0) { dataColAppendVal(&(target->cols[i]), tdGetColDataOfRow(src1->cols + i, *iter1), target->numOfRows,