Fix detach_false_primary bug.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Apr 2018 05:54:17 +0000 (14:54 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Apr 2018 05:54:17 +0000 (14:54 +0900)
Let regard any socket file staring with '/' is a UNIX domain socket
directory.

src/main/pgpool_main.c

index 8a97064bd60bd8922e5350da923a457f6ffe0f45..ff563f3b71af6059aba13b117f4539f2703a045f 100644 (file)
@@ -3037,9 +3037,9 @@ verify_backend_node_status(POOL_CONNECTION_POOL_SLOT **slots)
                                                backend_info = pool_get_node_info(i);
 
                                                /* verify host and port */
-                                               if (((!strcmp(backend_info->backend_hostname, "/tmp") && *host == '\0') ||
-                                                        !strcmp(backend_info->backend_hostname, host)) &&
-                                                       (backend_info->backend_port == atoi(port)))
+                                               if ((*backend_info->backend_hostname == '/' && *host == '\0') ||
+                                                       (!strcmp(backend_info->backend_hostname, host) &&
+                                                        backend_info->backend_port == atoi(port)))
                                                {
                                                        /* the standby connects to the primary */
                                                        primary[i]++;