Chris Browne cbbrowne at lists.slony.info
Thu Oct 25 11:32:02 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv11971

Modified Files:
	remote_worker.c 
Log Message:
Oops - add in missing function that was added to 1.2 branch


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -d -r1.158 -r1.159
*** remote_worker.c	23 Oct 2007 16:55:49 -0000	1.158
--- remote_worker.c	25 Oct 2007 18:32:00 -0000	1.159
***************
*** 264,267 ****
--- 264,268 ----
  static void compress_actionseq(const char *ssy_actionseq, SlonDString * action_subquery);
  
+ static int check_set_subscriber(int set_id, int node_id,PGconn * local_dbconn);
  
  /* ----------
***************
*** 1251,1254 ****
--- 1252,1256 ----
  				int num_statements = -1, stmtno;
  				int  node_in_set;
+ 				int localNodeId;
  
  				PGresult *res;
***************
*** 5561,5562 ****
--- 5563,5596 ----
  	slon_log(SLON_DEBUG4, " compressed actionseq subquery... %s\n", dstring_data(action_subquery));
  }
+ 
+ /**
+  * Checks to see if the node specified is a member of the set.
+  *
+  */
+ static int check_set_subscriber(int set_id, int node_id,PGconn * local_dbconn) 
+ {
+   
+   
+   SlonDString query1;
+   PGresult* res;
+   dstring_init(&query1);
+ 
+   slon_appendquery(&query1,"select 1 from %s.sl_subscribe WHERE sub_set=%d AND sub_receiver=%d for update"
+ 	       ,rtcfg_namespace,set_id,node_id);
+   res = PQexec(local_dbconn,dstring_data(&query1));
+   if(PQresultStatus(res)!=PGRES_TUPLES_OK) {
+     slon_log(SLON_ERROR,"remoteWorkerThread_%d: DDL preparation can not check set membership"
+ 	     ,node_id);
+ 	dstring_free(&query1);
+     slon_retry();
+   }
+   dstring_free(&query1);
+   if(PQntuples(res)==0) {
+     PQclear(res);
+     return 0;
+   }
+   PQclear(res);
+   return 1;
+ 
+ 
+ }



More information about the Slony1-commit mailing list