Merge pull request #689 from taosdata/feature/mergecode

Unable to establish connection when IP address is NULL
This commit is contained in:
fangpanpan 2019-11-09 13:52:16 +08:00 committed by GitHub
commit d3941fe95b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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