From 1878e2955a7f7a3fed23c383a3b2b6ec9cf1af5c Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 25 Oct 2023 21:18:31 +0800 Subject: [PATCH] fix: dsn can not empty --- tools/shell/src/shellUtil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shell/src/shellUtil.c b/tools/shell/src/shellUtil.c index f57c449961..0350d934a7 100644 --- a/tools/shell/src/shellUtil.c +++ b/tools/shell/src/shellUtil.c @@ -130,7 +130,7 @@ void shellCheckConnectMode() { } if (shell.args.cloud) { shell.args.dsn = getenv("TDENGINE_CLOUD_DSN"); - if (shell.args.cloud_dsn) { + if (shell.args.dsn && strlen(shell.args.dsn) > 4) { shell.args.cloud = true; shell.args.local = false; shell.args.restful = false; @@ -138,7 +138,7 @@ void shellCheckConnectMode() { } shell.args.dsn = getenv("TDENGINE_DSN"); - if (shell.args.dsn) { + if (shell.args.dsn && strlen(shell.args.dsn) > 4) { shell.args.cloud = true; shell.args.local = true; shell.args.restful = false;