Jan Wieck wieck at lists.slony.info
Fri Apr 30 16:15:57 PDT 2010
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv10270/src/slon

Modified Files:
	remote_worker.c 
Log Message:
The patch for an issue reported on the mailing list where 
tuples with large rows where causing data corruption (reported
as invalid utf8 characters) because the memory was freed while
it was still being used.

This issue was introduced with 1.176.2.8 on Feb 11 2010


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -C 2 -d -r1.185 -r1.186
*** remote_worker.c	11 Feb 2010 19:36:31 -0000	1.185
--- remote_worker.c	30 Apr 2010 23:15:55 -0000	1.186
***************
*** 4953,4957 ****
  						log_cmddata = PQgetvalue(res2, 0, 0);
  						largemem = log_cmdsize;
- 						PQclear(res2);
  					}
  
--- 4953,4956 ----
***************
*** 4964,4968 ****
--- 4963,4971 ----
  					if (log_tableid >= wd->tab_fqname_size ||
  						wd->tab_fqname[log_tableid] == NULL)
+ 					{
+ 						if (largemem > 0)
+ 							PQclear(res2);
  						continue;
+ 					}
  
  					/*
***************
*** 5019,5023 ****
--- 5022,5031 ----
  					{
  						if (data_line_last >= data_line_alloc)
+ 						{
+ 							if (largemem > 0)
+ 								PQclear(res2);
  							break;
+ 						}
+ 
  						line_no = data_line_last++;
  
***************
*** 5038,5041 ****
--- 5046,5050 ----
  					if (largemem > 0)
  					{
+ 						PQclear(res2);
  						pthread_mutex_lock(&(wd->workdata_lock));
  						wd->workdata_largemem += largemem;



More information about the Slony1-commit mailing list