From bd33d54011c25d6e712e28853e15ff99e23642a9 Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 29 Dec 2022 09:52:47 +0800 Subject: [PATCH] fix: force set null logic for kvrow --- src/common/src/tdataformat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index d593d1b748..ae79256f21 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -510,7 +510,9 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo while (dcol < pCols->numOfCols) { SDataCol *pDataCol = &(pCols->cols[dcol]); if (rcol >= nRowCols || rcol >= schemaNCols(pSchema)) { - dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + if (forceSetNull) { + dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + } ++dcol; continue; } @@ -523,7 +525,7 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo dataColAppendVal(pDataCol, value, pCols->numOfRows, pCols->maxPoints, rowOffset); } else if (rowOffset == -1) { // for update 2 - if (value && !isNull(value, pDataCol->type)) { + if (!isNull(value, pDataCol->type)) { dataColAppendVal(pDataCol, value, pCols->numOfRows, pCols->maxPoints, rowOffset); } } else { -- GitLab