bugzilla-daemon at main.slony.info bugzilla-daemon at main.slony.info
Tue Nov 22 12:20:33 PST 2011
http://www.slony.info/bugzilla/show_bug.cgi?id=250

--- Comment #3 from Steve Singer <ssinger at ca.afilias.info> 2011-11-22 12:20:33 PST ---
(In reply to comment #2)
> Ready for review

+   dstring_init(&query);
+   slon_mkquery(&query,"select 1 from pg_catalog.pg_settings where name=
'application_name'; ");
+   res = PQexec (dbconn, dstring_data(&query));
+   
+   if (PQresultStatus(res) != PGRES_TUPLES_OK)
+           return -1;

&query should be free'd before the return
Just free it before the PQresultStatus  call.

+   dstring_free(&query); 
+
+   if (PQntuples(res) == 0)
+   {
+           PQclear(res);
+   } else {
+           PQclear(res);
+           dstring_init(&query);
+           slon_mkquery(&query,"SET application_name TO 'slony_logshipper';
");
+           res=PQexec(dbconn, dstring_data(&query));
+           dstring_free(&query); 
+           PQclear(res);
+   }
+

Otherwise this seems fine for checkin.

-- 
Configure bugmail: http://www.slony.info/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Slony1-bugs mailing list