CVS User Account cvsuser
Fri Dec 3 17:16:06 PST 2004
Log Message:
-----------
Create confirm records for all old events when slonik creates
a spool node.

Jan

Modified Files:
--------------
    slony1-engine/src/slonik:
        slonik.c (r1.36 -> r1.37)

-------------- next part --------------
Index: slonik.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slonik/slonik.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -Lsrc/slonik/slonik.c -Lsrc/slonik/slonik.c -u -w -r1.36 -r1.37
--- src/slonik/slonik.c
+++ src/slonik/slonik.c
@@ -2291,6 +2291,24 @@
 		return -1;
 	}
 
+	/* If the new node is a spool node, produce confirm rows for it */
+	if (stmt->no_spool)
+	{
+		slon_mkquery(&query,
+				"insert into \"_%s\".sl_confirm select "
+				"    ev_origin, %d, max(ev_seqno), CURRENT_TIMESTAMP "
+				"    from \"_%s\".sl_event group by 1, 2, 4; ",
+				stmt->hdr.script->clustername,
+				stmt->no_id,
+				stmt->hdr.script->clustername);
+
+		if (db_exec_command((SlonikStmt *)stmt, adminfo2, &query) < 0)
+		{
+			dstring_free(&query);
+			return -1;
+		}
+	}
+
 	dstring_free(&query);
 	return 0;
 }


More information about the Slony1-commit mailing list