Fri Aug 4 13:06:24 PDT 2006
- Previous message: [Slony1-commit] By xfade: More unused var warnings.
- Next message: [Slony1-commit] By xfade: Fix bug in checking for version 7.2 or lower found by Steve
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Augment test #1 to include a table consisting of varied types to
verify that they all replicate properly:
create table table5 (
id serial primary key,
numcol numeric(12,4), -- 1.23
realcol real, -- (1.23)
ptcol point, -- (1,2)
pathcol path, -- ((1,1),(2,2),(3,3),(4,4))
polycol polygon, -- ((1,1),(2,2),(3,3),(4,4))
circcol circle, -- <(1,2>,3>
ipcol inet, -- "192.168.1.1"
maccol macaddr, -- "04:05:06:07:08:09"
bitcol bit varying(20) -- X'123'
);
Modified Files:
--------------
slony1-engine/tests/test1:
README (r1.4 -> r1.5)
generate_dml.sh (r1.7 -> r1.8)
init_add_tables.ik (r1.7 -> r1.8)
init_data.sql (r1.1 -> r1.2)
init_schema.sql (r1.4 -> r1.5)
-------------- next part --------------
Index: init_add_tables.ik
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/test1/init_add_tables.ik,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltests/test1/init_add_tables.ik -Ltests/test1/init_add_tables.ik -u -w -r1.7 -r1.8
--- tests/test1/init_add_tables.ik
+++ tests/test1/init_add_tables.ik
@@ -5,10 +5,12 @@
set add table (id=3, set id=1, origin=1, fully qualified name = 'public.table3', key = SERIAL);
try {
- set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table4', key = 'no_good_candidate_pk');
+ set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table4', key = 'no_good_candidate_pk', comment='bad table - table 4');
} on error {
echo 'Tried to replicate table4 with no good candidate PK - rejected';
} on success {
echo 'Tried to replicate table4 with no good candidate PK - accepted';
exit 1;
}
+
+set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table5', comment='a table of many types');
\ No newline at end of file
Index: generate_dml.sh
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/test1/generate_dml.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltests/test1/generate_dml.sh -Ltests/test1/generate_dml.sh -u -w -r1.7 -r1.8
--- tests/test1/generate_dml.sh
+++ tests/test1/generate_dml.sh
@@ -38,9 +38,13 @@
txtblen=$(random_number 1 100)
txtb=$(random_string ${txtblen})
txtb=`echo ${txtb} | sed -e "s/\\\\\\\/\\\\\\\\\\\\\\/g" -e "s/'/''/g"`
+ ra=$(random_number 1 9)
+ rb=$(random_number 1 9)
+ rc=$(random_number 1 9)
echo "INSERT INTO table1(data) VALUES ('${txta}');" >> $GENDATA
echo "INSERT INTO table2(table1_id,data) SELECT id, '${txtb}' FROM table1 WHERE data='${txta}';" >> $GENDATA
echo "INSERT INTO table3(table2_id) SELECT id FROM table2 WHERE data ='${txtb}';" >> $GENDATA
+ echo "INSERT INTO table5(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('${ra}${rb}.${rc}','${ra}.${rb}${rc}','(${ra},${rb})','((${ra},${ra}),(${rb},${rb}),(${rc},${rc}),(${ra},${rc}))','((${ra},${rb}),(${rc},${ra}),(${rb},${rc}),(${rc},${rb}))','<(${ra},${rb}),${rc}>','192.168.${ra}.${rb}${rc}','08:00:2d:0${ra}:0${rb}:0${rc}',X'${ra}${rb}${rc}');" >> $GENDATA
if [ ${i} -ge ${numrows} ]; then
break;
else
Index: init_data.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/test1/init_data.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltests/test1/init_data.sql -Ltests/test1/init_data.sql -u -w -r1.1 -r1.2
--- tests/test1/init_data.sql
+++ tests/test1/init_data.sql
@@ -1,3 +1,10 @@
INSERT INTO table1(data) VALUES ('placeholder 1');
+INSERT INTO table1(data) VALUES ('placeholder 2');
INSERT INTO table2(table1_id,data) VALUES (1,'placeholder 1');
+INSERT INTO table2(table1_id,data) VALUES (2,'placeholder 2');
INSERT INTO table3(table2_id) VALUES (1);
+INSERT INTO table3(table2_id) VALUES (2);
+
+INSERT INTO table5(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('74.0','7.40','(7,4)','((7,7),(4,4),(0,0),(7,0))','((7,4),(0,7),(4,0),(0,4))','<(7,4),0>','192.168.7.40','08:00:2d:07:04:00',X'740');
+
+INSERT INTO table5(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('93.1','9.31','(9,3)','((9,9),(3,3),(1,1),(9,1))','((9,3),(1,9),(3,1),(1,3))','<(9,3),1>','192.168.9.31','08:00:2d:09:03:01',X'931');
\ No newline at end of file
Index: init_schema.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/test1/init_schema.sql,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltests/test1/init_schema.sql -Ltests/test1/init_schema.sql -u -w -r1.4 -r1.5
--- tests/test1/init_schema.sql
+++ tests/test1/init_schema.sql
@@ -25,3 +25,16 @@
);
create unique index no_good_candidate_pk on table4 (id, id2);
\ No newline at end of file
+
+create table table5 (
+ id serial primary key,
+ numcol numeric(12,4), -- 1.23
+ realcol real, -- (1.23)
+ ptcol point, -- (1,2)
+ pathcol path, -- ((1,1),(2,2),(3,3),(4,4))
+ polycol polygon, -- ((1,1),(2,2),(3,3),(4,4))
+ circcol circle, -- <(1,2>,3>
+ ipcol inet, -- "192.168.1.1"
+ maccol macaddr, -- "04:05:06:07:08:09"
+ bitcol bit varying(20) -- X'123'
+);
Index: README
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/test1/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltests/test1/README -Ltests/test1/README -u -w -r1.4 -r1.5
--- tests/test1/README
+++ tests/test1/README
@@ -18,3 +18,9 @@
It actually tries replicating a fourth table, which has an invalid
candidate primary key (columns not defined NOT NULL), which should
cause it to be rejected. That is done in a slonik TRY {} block.
+
+It also creates...
+
+5. table5 which has columns of all sorts of vaguely esoteric types to
+exercise that points, paths, bitmaps, mac addresses, and inet types
+replicate properly.
- Previous message: [Slony1-commit] By xfade: More unused var warnings.
- Next message: [Slony1-commit] By xfade: Fix bug in checking for version 7.2 or lower found by Steve
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list