From 9dcaa53e128c6048c332809e7bc46623247d2844 Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 13 Jul 2021 06:43:49 +0000 Subject: [PATCH] code optimization --- src/client/src/tscParseInsert.c | 4 ++-- src/inc/taosdef.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 5d3f41acd3..0081dac11b 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 acebdaa30a..7c6b3bbed9 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 -- GitLab