From 187a6b6d234e46247244071c3a50210623cfe88d Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 3 Mar 2015 18:50:48 +0900 Subject: [PATCH] Fix slot name --- dbutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbutils.c b/dbutils.c index 5e5ae2e3..4f81ed4e 100644 --- a/dbutils.c +++ b/dbutils.c @@ -307,7 +307,8 @@ guc_set_typed(PGconn *conn, const char *parameter, const char *op, char sqlquery[QUERY_STR_LEN]; int retval = 1; - sqlquery_snprintf(sqlquery, "SELECT true FROM pg_settings " + sqlquery_snprintf(sqlquery, + "SELECT true FROM pg_settings " " WHERE name = '%s' AND setting::%s %s '%s'::%s", parameter, datatype, op, value, datatype); @@ -934,7 +935,7 @@ create_node_record(PGconn *conn, char *action, int node, char *type, int upstrea maxlen_snprintf(upstream_node_id, "%i", upstream_node); } - if(slot_name == NULL) + if(slot_name != NULL && slot_name[0]) { maxlen_snprintf(slot_name_buf, "'%s'", slot_name); }