CVS User Account cvsuser
Mon Oct 31 16:05:34 PST 2005
Log Message:
-----------
Long cluster name causes cluster to not operate properly (ID: 1436) 

"In set creation I allowed slony1 to create unique indexes on a handful
of unkeyed tables. When the cluster name was long, the complete name
it uses for those columns was truncated. The create set script/process
did not detect this condition and thus all subsequent operations on
those tables failed. I also had to manually drop those columns, as the
uninstall process failed as well."

Changed node creation to check for this, comparing cluster name size
to NAMEDATALEN.

Modified Files:
--------------
    slony1-engine/src/slonik:
        slonik.c (r1.49 -> r1.50)

-------------- next part --------------
Index: slonik.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slonik/slonik.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -Lsrc/slonik/slonik.c -Lsrc/slonik/slonik.c -u -w -r1.49 -r1.50
--- src/slonik/slonik.c
+++ src/slonik/slonik.c
@@ -1916,6 +1916,14 @@
 				   adminfo->version_major, adminfo->version_minor);
 	}
 
+#define ROWIDBITS "_Slony-I__rowID"
+
+	if (strlen(stmt->script->clustername) + strlen("ROWIDBITS") > NAMEDATALEN) {
+		printf ("Cluster name %s too long to permit creation of columns containing %s - maximum name length: %d\n", 
+			stmt->script->clustername, ROWIDBITS, NAMEDATALEN);
+		return -1;
+        }
+	
 	dstring_init(&query);
 
 	/* Create the cluster namespace */


More information about the Slony1-commit mailing list