diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 5d3f41acd3dd3aeab02823d85a2d7bf4a9a930ce..0081dac11bbe53295d538cafe2d16fdc11ed9bb0 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -685,8 +685,8 @@ static int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pToken, char *pay if (pToken->type == TK_NULL) { payloadColSetId(payload, pSchema->colId); payloadColSetType(payload, pSchema->type); - memcpy(POINTER_SHIFT(payloadStart,tOffset), tdGetNullVal(TSDB_DATA_TYPE_NCHAR), VARSTR_HEADER_SIZE + INT_BYTES); - *sizeAppend = (TDRowLenT)(VARSTR_HEADER_SIZE + INT_BYTES); + memcpy(POINTER_SHIFT(payloadStart,tOffset), tdGetNullVal(TSDB_DATA_TYPE_NCHAR), VARSTR_HEADER_SIZE + TSDB_NCHAR_SIZE); + *sizeAppend = (TDRowLenT)(VARSTR_HEADER_SIZE + TSDB_NCHAR_SIZE); } else { // if the converted output len is over than pColumnModel->bytes, return error: 'Argument list too long' int32_t output = 0; diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index acebdaa30a9055f894d791101ab3f1ebeeda8c2e..7c6b3bbed91dd5a8cca8d6670a848ada7d55a42f 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -199,9 +199,9 @@ do { \ * In some scenarios uint16_t (0~65535) is used to store the row len. * - Firstly, we use 65531(65535 - 4), as the SDataRow and SKVRow including 4 bits header. * - Secondly, if all cols are VarType except primary key, we need 4 bits to store the offset, thus - * the final value is 65531-8-4095*4 = 49143. + * the final value is 65531-(4096-1)*4 = 49151. */ -#define TSDB_MAX_BYTES_PER_ROW 49143 +#define TSDB_MAX_BYTES_PER_ROW 49151 #define TSDB_MAX_TAGS_LEN 16384 #define TSDB_MAX_TAGS 128 #define TSDB_MAX_TAG_CONDITIONS 1024