From fef33e91b305cab28041217680bb52a5df2a832b Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 10 Jul 2024 09:49:46 +0000 Subject: [PATCH 1/3] fix/TS-5154 --- source/common/src/tglobal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 84d4e7b7e7..d733bb22d8 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -1344,7 +1344,7 @@ int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char * return -1; } - tstrncpy(tsDataDir, cfgGetItem(pCfg, "dataDir")->str, PATH_MAX); + if (taosSetTfsCfg(pCfg) != 0) return -1; dDebugFlag = cfgGetItem(pCfg, "dDebugFlag")->i32; cfgCleanup(pCfg); From c6c323f40e68686ee3151d99cbf9149ad8694456 Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 11 Jul 2024 05:45:06 +0000 Subject: [PATCH 2/3] fix/TS-5154 --- source/common/src/tglobal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index d733bb22d8..119438fbd6 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -1344,7 +1344,10 @@ int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char * return -1; } - if (taosSetTfsCfg(pCfg) != 0) return -1; + if (taosSetTfsCfg(pCfg) != 0) { + cfgCleanup(pCfg); + return -1; + } dDebugFlag = cfgGetItem(pCfg, "dDebugFlag")->i32; cfgCleanup(pCfg); From 051956eb82de4bc89ed02d013e184cdb5d826a62 Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 11 Jul 2024 05:54:47 +0000 Subject: [PATCH 3/3] fix/TS-5154 --- source/dnode/mgmt/exe/dmMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 65f695cb8b..1c5541de29 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -369,7 +369,7 @@ int mainWindows(int argc, char **argv) { if(global.generateCode) { bool toLogFile = false; if(taosReadDataFolder(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs) != 0){ - encryptError("failed to generate encrypt code since taosd is running, please stop it first"); + encryptError("failed to generate encrypt code since dataDir can not be set from cfg file"); return -1; };