CVS User Account cvsuser
Fri Jun 23 14:38:05 PDT 2006
Log Message:
-----------
Make the tests for datestyles more extensive:
- Test an array of them
- Test a domain that derives from TIMESTAMPTZ

Modified Files:
--------------
    slony1-engine/tests/testdatestyles:
        README (r1.1 -> r1.2)
        generate_dml.sh (r1.1 -> r1.2)
        init_schema.sql (r1.1 -> r1.2)

-------------- next part --------------
Index: generate_dml.sh
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/testdatestyles/generate_dml.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltests/testdatestyles/generate_dml.sh -Ltests/testdatestyles/generate_dml.sh -u -w -r1.1 -r1.2
--- tests/testdatestyles/generate_dml.sh
+++ tests/testdatestyles/generate_dml.sh
@@ -64,6 +64,14 @@
 	  done
        done
      done     
+     for u1 in 0 1 2 3 4 5 6 7 8 9; do
+        for inc in 0 1 2 3 4 5 6 7 8 9 10; do
+           echo "update table1 set ts = ts - '5 days'::interval + '${inc} days'::interval,
+                                   tsz = tsz - '5 days'::interval + '${inc} days'::interval,
+                                   ds = ds - '5 days'::interval + '${inc} days'::interval
+                 where id in (select id from table1 order by random() limit 5);" >> $GENDATA
+	done
+     done
   done
   status "done"
 }
Index: init_schema.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/testdatestyles/init_schema.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltests/testdatestyles/init_schema.sql -Ltests/testdatestyles/init_schema.sql -u -w -r1.1 -r1.2
--- tests/testdatestyles/init_schema.sql
+++ tests/testdatestyles/init_schema.sql
@@ -1,9 +1,13 @@
+create domain alt_timestamptz timestamptz;
+
 CREATE TABLE table1(
   id            SERIAL PRIMARY KEY, 
   ts            TIMESTAMP,
-  tsz           TIMESTAMPTZ,
+  tsz           alt_timestamptz,
   ds            DATE,
   nowts         TIMESTAMP DEFAULT NOW(),
   nowtsz        TIMESTAMPTZ DEFAULT NOW(),
-  nowds         DATE DEFAULT NOW()
+  nowds         DATE DEFAULT NOW(),
+  tsz_array     TIMESTAMPTZ[] DEFAULT '{now(),now()}'
 );
+
Index: README
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tests/testdatestyles/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltests/testdatestyles/README -Ltests/testdatestyles/README -u -w -r1.1 -r1.2
--- tests/testdatestyles/README
+++ tests/testdatestyles/README
@@ -2,3 +2,10 @@
 
 This test involves submitting date and timestamps in various DATESTYLE
 forms, and verifying that all load in properly.
\ No newline at end of file
+
+Note that it tests several derivations:
+- DATE
+- TIMESTAMP
+- TIMESTAMPTZ
+- A domain that derives from TIMESTAMPTZ
+- An array of TIMESTAMPTZ values



More information about the Slony1-commit mailing list