Fix nasty bug with pgpool_recovery() in 4.3 or later.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 12 Oct 2021 06:16:49 +0000 (15:16 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 12 Oct 2021 06:16:49 +0000 (15:16 +0900)
Reported by Kawamoto and Peng Bo.

src/sql/pgpool-recovery/pgpool-recovery.c

index 515a2ee2b0f36f1614955403b3cebcdb64c9eb4e..77f92753e86b142645d35a31991608de10b10f49 100644 (file)
@@ -96,7 +96,7 @@ pgpool_recovery(PG_FUNCTION_ARGS)
                                 DataDir, script, DataDir, remote_host,
                                 remote_data_directory, primary_port, remote_node, remote_port, primary_host);
        }
-       if (PG_NARGS() >= 6)            /* Pgpool-II 4.1 or 4.2 */
+       else if (PG_NARGS() >= 6)               /* Pgpool-II 4.1 or 4.2 */
        {
                char       *primary_port = DatumGetCString(DirectFunctionCall1(textout,
                                                                                                                                          PointerGetDatum(PG_GETARG_TEXT_P(3))));