OSDN Git Service

This patch adds a new regression test for the UPDATE command. Right
authorBruce Momjian <bruce@momjian.us>
Tue, 26 Aug 2003 18:32:23 +0000 (18:32 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 26 Aug 2003 18:32:23 +0000 (18:32 +0000)
now all that is tested is Rod Taylor's recent addition to allow
this syntax:

    UPDATE ... SET <col> = DEFAULT;

If anyone else would like to add more UPDATE tests, go ahead --
I just wanted to write a test for the above functionality, and
couldn't see an existing test that it would be appropriate
to add to.

Neil Conway

src/test/regress/expected/update.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/update.sql [new file with mode: 0644]

diff --git a/src/test/regress/expected/update.out b/src/test/regress/expected/update.out
new file mode 100644 (file)
index 0000000..3fca2fb
--- /dev/null
@@ -0,0 +1,25 @@
+--
+-- UPDATE ... SET <col> = DEFAULT;
+--
+CREATE TABLE update_test (
+    a   INT DEFAULT 10,
+    b   INT
+);
+INSERT INTO update_test VALUES (5, 10);
+INSERT INTO update_test VALUES (10, 15);
+SELECT * FROM update_test;
+ a  | b  
+----+----
+  5 | 10
+ 10 | 15
+(2 rows)
+
+UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+SELECT * FROM update_test;
+ a  | b 
+----+---
+ 10 |  
+ 10 |  
+(2 rows)
+
+DROP TABLE update_test;
index 913c4cb..974dd2e 100644 (file)
@@ -60,7 +60,7 @@ ignore: random
 # ----------
 # The fourth group of parallel test
 # ----------
-test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index
+test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update
 
 test: privileges
 test: misc
index d3ae9f5..c3a9fd7 100644 (file)
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.20 2003/07/01 19:10:53 tgl Exp $
+# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.21 2003/08/26 18:32:23 momjian Exp $
 # This should probably be in an order similar to parallel_schedule.
 test: boolean
 test: char
@@ -72,6 +72,7 @@ test: portals
 test: arrays
 test: btree_index
 test: hash_index
+test: update
 test: privileges
 test: misc
 test: select_views
diff --git a/src/test/regress/sql/update.sql b/src/test/regress/sql/update.sql
new file mode 100644 (file)
index 0000000..64e0f81
--- /dev/null
@@ -0,0 +1,19 @@
+--
+-- UPDATE ... SET <col> = DEFAULT;
+--
+
+CREATE TABLE update_test (
+    a   INT DEFAULT 10,
+    b   INT
+);
+
+INSERT INTO update_test VALUES (5, 10);
+INSERT INTO update_test VALUES (10, 15);
+
+SELECT * FROM update_test;
+
+UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+
+SELECT * FROM update_test;
+
+DROP TABLE update_test;
\ No newline at end of file