CVS User Account cvsuser
Wed Jul 13 20:58:10 PDT 2005
Log Message:
-----------
Bug #1362 - subscribeSet() must check that the provider itself is a forwarding subscriber

As checked into HEAD...

Change subscribeSet() to validate that the provider is either the origin
or a forwarding active subscriber

Tags:
----
REL_1_0_STABLE

Modified Files:
--------------
    slony1-engine/src/backend:
        slony1_funcs.sql (r1.15.2.17 -> r1.15.2.18)

-------------- next part --------------
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.15.2.17
retrieving revision 1.15.2.18
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.15.2.17 -r1.15.2.18
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -3434,6 +3434,7 @@
 	p_sub_receiver		alias for $3;
 	p_sub_forward		alias for $4;
 	v_set_origin		int4;
+	v_rec			record;
 begin
 	-- ----
 	-- Grab the central configuration lock
@@ -3476,6 +3477,20 @@
 		raise notice ''http://gborg.postgresql.org/project/slony1/bugs/bugupdate.php?1226'';
 	end if;
 
+	-- ---
+	-- Verify that the provider is either the origin or an active subscriber
+	-- Bug report #1362
+	-- ---
+	if v_set_origin <> p_sub_provider then
+		select 1 into v_rec from @NAMESPACE at .sl_subscribe
+			where sub_set = p_sub_set and 
+                              sub_receiver = p_sub_provider and
+			      sub_forward and sub_active;
+		if not found then
+			raise exception ''Slony-I: provider % is not an active forwarding node for replication set %'', p_sub_provider, p_sub_set;
+		end if;
+	end if;
+
 	-- ----
 	-- Call the internal procedure to store the subscription
 	-- ----


More information about the Slony1-commit mailing list