From 3c3edeb241bad2e858b828106af08cd93c22c10d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 9 Nov 2019 13:39:30 +0800 Subject: [PATCH] Unable to establish connection when IP address is NULL --- src/client/src/tscSql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index e6714bb4cb..fa72b18d16 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -157,7 +157,7 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const } TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, int port) { - if (ip != NULL && (strcmp("127.0.0.1", ip) == 0 || strcasecmp("localhost", ip) == 0)) { + if (ip == NULL || (ip != NULL && (strcmp("127.0.0.1", ip) == 0 || strcasecmp("localhost", ip) == 0))) { #ifdef CLUSTER ip = tsPrivateIp; #else -- GitLab