Created attachment 69 [details] Patch to fix this issue. When executing DDL script using the EXECUTE SCRIPT command, multi-line statements are not handled correctly. When a line is longer than subsequent lines, concatenation does not work. An example statement: ALTER TABLE customers ADD COLUMN description TEXT; The attached patch fixes the issue on version 1.2.21.
Created attachment 70 [details] alternate patch for 161 This is an alternate way of fixing the bug. I think the real issue is that the length passed to memcpy doesn't account for the terminating null character. I'm not convinced the other patch will work if the first line is 256 characters long.
Created attachment 71 [details] Patch to DDL script test I added a multiline statement of the appropriate form into the DDL test; it completes fine. I suspect what we need, instead, is to have a sample DDL statement that is rather a lot longer, e.g. about 300 bytes long. Steve's patch seems more general in purpose to me...
Applied to REL_2_1_STABLE and master. I am not sure why this wasn't committed when a year ago when Chris gave the okay. http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=commit;h=96a7cad9f90758677273aa9a4e95c9a30062e62e http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=commit;h=0b6ee7ebcde56ff2f9819341547b9e147f8e1ff1