diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 07acb20cbe..4ead7d4180 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -189,7 +189,6 @@ static FORCE_INLINE void tscAppendMemRowColVal(SMemRow row, const void *value, b int8_t colType, int32_t toffset, SMemRowBuilder *pBuilder, int32_t rowNum) { tdAppendMemRowColVal(row, value, isCopyVarData, colId, colType, toffset); - // TODO: When nBoundCols/nCols > 0.5, if (pBuilder->compareStat == ROW_COMPARE_NEED) { SMemRowInfo *pRowInfo = pBuilder->rowInfo + rowNum; tdGetColAppendDeltaLen(value, colType, &pRowInfo->dataLen, &pRowInfo->kvLen); @@ -201,7 +200,6 @@ static FORCE_INLINE void tscAppendMemRowColValEx(SMemRow row, const void *value, int8_t colType, int32_t toffset, int32_t *dataLen, int32_t *kvLen, uint8_t compareStat) { tdAppendMemRowColVal(row, value, isCopyVarData, colId, colType, toffset); - // TODO: When nBoundCols/nCols > 0.5, if (compareStat == ROW_COMPARE_NEED) { tdGetColAppendDeltaLen(value, colType, dataLen, kvLen); } @@ -581,8 +579,8 @@ static FORCE_INLINE void convertToSKVRow(SMemRow dest, SMemRow src, SSchema *pSc int32_t toffset = 0, kvOffset = 0; for (int i = 0; i < nCols; ++i) { - SSchema *schema = pSchema + i; if ((spd->cols + i)->valStat == VAL_STAT_HAS) { + SSchema *schema = pSchema + i; toffset = (spd->cols + i)->toffset; void *val = tdGetRowDataOfCol(dataRow, schema->type, toffset + TD_DATA_ROW_HEAD_SIZE); tdAppendKvColVal(kvRow, val, true, schema->colId, schema->type, kvOffset); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 6db272002d..3c35795b0d 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1807,10 +1807,11 @@ static int trimDataBlock(void* pDataBlock, STableDataBlocks* pTableDataBlock, SI int32_t schemaSize = sizeof(STColumn) * numOfCols; pBlock->schemaLen = schemaSize; } else { - for (int32_t j = 0; j < tinfo.numOfColumns; ++j) { - flen += TYPE_BYTES[pSchema[j].type]; + if (IS_RAW_PAYLOAD(insertParam->payloadType)) { + for (int32_t j = 0; j < tinfo.numOfColumns; ++j) { + flen += TYPE_BYTES[pSchema[j].type]; + } } - pBlock->schemaLen = 0; }