Fix false primary node detection code.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Apr 2018 14:42:52 +0000 (23:42 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Apr 2018 14:42:52 +0000 (23:42 +0900)
The previous commit was wrong.

src/main/pgpool_main.c

index ff563f3b71af6059aba13b117f4539f2703a045f..a4b46b65d2bc34006b1084b220fc3adf74a8ea99 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 ((*backend_info->backend_hostname == '/' && *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]++;