diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index e6714bb4cb25747a10c695e9261d5e5dcfc47137..fa72b18d164f8db92e6da9e2baf77621d61f9145 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