Unable to establish connection when IP address is NULL
This commit is contained in:
parent
1c3fcabe04
commit
3c3edeb241
|
@ -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) {
|
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
|
#ifdef CLUSTER
|
||||||
ip = tsPrivateIp;
|
ip = tsPrivateIp;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue