From 165b9cf516982ef959868f81a5ca7cbd280a5765 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 12 Apr 2022 15:39:49 +0800 Subject: [PATCH] fix(shell): print taos_connect failed reason befor exiting --- src/client/src/tscSql.c | 2 ++ src/kit/shell/src/shellEngine.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index ae5a322b05..8a2b2752a1 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -224,6 +224,8 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass, } } + printf("connect failed, reason: %s\n\n", taos_errstr(pSql)); + return NULL; } diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 1675473493..c54cd9fa75 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -87,7 +87,6 @@ TAOS *shellInit(SShellArguments *_args) { } if (con == NULL) { - printf("\033[31mfailed to connect to db, reason:%s\033[0m\n", taos_errstr(con)); fflush(stdout); return con; } -- GitLab