Chris Browne cbbrowne at lists.slony.info
Fri Apr 20 14:40:04 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/tests/testlogship
In directory main.slony.info:/tmp/cvs-serv4488/tests/testlogship

Modified Files:
      Tag: REL_1_2_STABLE
	README generate_dml.sh schema.diff 
Added Files:
      Tag: REL_1_2_STABLE
	ddl_updates.sql exec_ddl.sh 
Log Message:
Add a DDL script to the log shipping test in order to point out a bug
in SYNC counting in log shipping.


Index: README
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testlogship/README,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** README	20 Apr 2007 20:51:09 -0000	1.1.2.1
--- README	20 Apr 2007 21:40:02 -0000	1.1.2.2
***************
*** 19,23 ****
  It also creates...
  
! 3.  table3 which has columns of all sorts of vaguely esoteric types to
  exercise that points, paths, bitmaps, mac addresses, and inet types
  replicate properly.
--- 19,30 ----
  It also creates...
  
! 3.  table4 which has columns of all sorts of vaguely esoteric types to
  exercise that points, paths, bitmaps, mac addresses, and inet types
  replicate properly.
+ 
+ It then loads data into these tables.
+ 
+ The test proceeds to run a DDL script which alters the schema for
+ table 4, adding two new columns, one to be populated via a default,
+ for new tuples; the other has no default, but we assign the value 42
+ to all tuples existing at the time that the DDL script runs.
\ No newline at end of file

Index: generate_dml.sh
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testlogship/generate_dml.sh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** generate_dml.sh	20 Apr 2007 20:51:09 -0000	1.1.2.1
--- generate_dml.sh	20 Apr 2007 21:40:02 -0000	1.1.2.2
***************
*** 65,68 ****
--- 65,69 ----
  {
    originnode=${ORIGINNODE:-"1"}
+   SCRIPT=${mktmp}/slonik.script
    eval db=\$DB${originnode}
    eval host=\$HOST${originnode}
***************
*** 96,100 ****
    if [ $? -ne 0 ]; then
      warn 3 "loading data failed, see $mktmp/moredata.log for details"
!   fi 
    wait_for_catchup
    status "second data load complete - now load files into log shipped node"
--- 97,115 ----
    if [ $? -ne 0 ]; then
      warn 3 "loading data failed, see $mktmp/moredata.log for details"
!   fi
!   wait_for_catchup
! 
!   status "execute DDL script"
!   init_preamble
!   sh ${testname}/exec_ddl.sh ${testname} >> $SCRIPT
!   do_ik
!   status "completed DDL script"
! 
!   status "Generate some more data"
!   generate_initdata
!   eval db=\$DB${originnode}
!   status "loading extra data to node $db"
!   $pgbindir/psql -h $host -p $port -U $user -d $db < $mktmp/generate.data 1> ${mktmp}/even_more_data.log 2> ${mktmp}/even_more_data.log2
! 
    wait_for_catchup
    status "second data load complete - now load files into log shipped node"

--- NEW FILE: ddl_updates.sql ---
alter table table4 add column newcol timestamptz;
alter table table4 alter column newcol set default now();
alter table table4 add column newint integer;
update table4 set newint = 42;

--- NEW FILE: exec_ddl.sh ---
testname=$1
echo "
  EXECUTE SCRIPT (
       SET ID = 1,
       FILENAME = '${testname}/ddl_updates.sql',
       EVENT NODE = 1
    );
"

Index: schema.diff
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testlogship/schema.diff,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** schema.diff	20 Apr 2007 20:51:09 -0000	1.1.2.1
--- schema.diff	20 Apr 2007 21:40:02 -0000	1.1.2.2
***************
*** 1,3 ****
  SELECT id,data FROM table1 ORDER BY id
  SELECT id,table1_id,data FROM table2 ORDER BY id
! SELECT id,numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol, bitcol from table4 order by id;
--- 1,3 ----
  SELECT id,data FROM table1 ORDER BY id
  SELECT id,table1_id,data FROM table2 ORDER BY id
! SELECT id,numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol, bitcol, newcol, newint from table4 order by id;



More information about the Slony1-commit mailing list