From 9629fb6eb576e2a3cab50621bd00c62e813c12fc Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 21 Feb 2019 16:14:08 +0900 Subject: [PATCH] repmgrd: remove superfluous query buffer Query can be sent as-is, no need to copy it to a buffer. --- dbutils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dbutils.c b/dbutils.c index 998c909e..3f126eb6 100644 --- a/dbutils.c +++ b/dbutils.c @@ -322,8 +322,6 @@ is_standby(PGconn *conn) bool is_pgup(PGconn *conn, int timeout) { - char sqlquery[QUERY_STR_LEN]; - /* Check the connection status twice in case it changes after reset */ bool twice = false; @@ -346,8 +344,7 @@ is_pgup(PGconn *conn, int timeout) if (wait_connection_availability(conn, timeout) != 1) goto failed; - sqlquery_snprintf(sqlquery, "SELECT 1"); - if (PQsendQuery(conn, sqlquery) == 0) + if (PQsendQuery(conn, "SELECT 1") == 0) { log_warning(_("PQsendQuery: Query could not be sent to primary. %s\n"), PQerrorMessage(conn));