Passing empty string parameters in failover command when pgpool-II does not have...
authorMuhammad Usama <m.usama@gmail.com>
Wed, 29 Apr 2015 14:13:58 +0000 (19:13 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Wed, 29 Apr 2015 14:14:54 +0000 (19:14 +0500)
Instead of omitting the values for the parameters when pgpool-II does not have
any value for a particular parameter, It now passes an empty string instead to
the failover command, This makes sure that failover script will always receive
the exact number of expected parameters.

src/main/pgpool_main.c

index a20265b4a3e496cff8aee301f91f99ae78f54934..9990230977190663612d35c7b03a2b9ff484b048 100644 (file)
@@ -2406,7 +2406,7 @@ static int trigger_failover_command(int node, const char *command_line,
                                                        string_append_char(exec_cmd, newmaster->backend_hostname);
                                                else
                                                        /* no valid new master */
-                                                       string_append_char(exec_cmd, "");
+                                                       string_append_char(exec_cmd, "\"\"");
                                                break;
 
                                        case 'm': /* new master node id */
@@ -2423,7 +2423,7 @@ static int trigger_failover_command(int node, const char *command_line,
                                                }
                                                else
                                                        /* no valid new master */
-                                                       string_append_char(exec_cmd, "");
+                                                       string_append_char(exec_cmd, "\"\"");
                                                break;
 
                                        case 'R': /* new master database directory */
@@ -2432,7 +2432,7 @@ static int trigger_failover_command(int node, const char *command_line,
                                                        string_append_char(exec_cmd, newmaster->backend_data_directory);
                                                else
                                                        /* no valid new master */
-                                                       string_append_char(exec_cmd, "");
+                                                       string_append_char(exec_cmd, "\"\"");
                                                break;
 
                                        case 'M': /* old master node id */