From bda2cd306d7cf8fcd29f1fcdec1476103807041e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 27 Nov 2023 09:29:43 +0800 Subject: [PATCH] fix:memory leak & comment length --- source/client/src/clientMain.c | 1 + source/common/src/systable.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 2091bcf64f..3a91ae82d5 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -876,6 +876,7 @@ int taos_get_current_db(TAOS *taos, char *database, int len, int *required) { code = 0; } taosThreadMutexUnlock(&pTscObj->mutex); + releaseTscObj(*(int64_t *)taos); return code; } diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 89995fc326..1623d9f062 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -140,7 +140,7 @@ static const SSysDbTableSchema userStbsSchema[] = { {.name = "columns", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, {.name = "tags", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, {.name = "last_update", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, - {.name = "table_comment", .bytes = TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "table_comment", .bytes = TSDB_TB_COMMENT_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "watermark", .bytes = 64 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "max_delay", .bytes = 64 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "rollup", .bytes = 128 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},