Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1e10017

Browse files
committed
This patch adds a new regression test for the UPDATE command. Right
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
1 parent 47a4e2e commit 1e10017

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

src/test/regress/expected/update.out

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--
2+
-- UPDATE ... SET <col> = DEFAULT;
3+
--
4+
CREATE TABLE update_test (
5+
a INT DEFAULT 10,
6+
b INT
7+
);
8+
INSERT INTO update_test VALUES (5, 10);
9+
INSERT INTO update_test VALUES (10, 15);
10+
SELECT * FROM update_test;
11+
a | b
12+
----+----
13+
5 | 10
14+
10 | 15
15+
(2 rows)
16+
17+
UPDATE update_test SET a = DEFAULT, b = DEFAULT;
18+
SELECT * FROM update_test;
19+
a | b
20+
----+---
21+
10 |
22+
10 |
23+
(2 rows)
24+
25+
DROP TABLE update_test;

src/test/regress/parallel_schedule

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ignore: random
6060
# ----------
6161
# The fourth group of parallel test
6262
# ----------
63-
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
63+
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
6464

6565
test: privileges
6666
test: misc

src/test/regress/serial_schedule

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.20 2003/07/01 19:10:53 tgl Exp $
1+
# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.21 2003/08/26 18:32:23 momjian Exp $
22
# This should probably be in an order similar to parallel_schedule.
33
test: boolean
44
test: char
@@ -72,6 +72,7 @@ test: portals
7272
test: arrays
7373
test: btree_index
7474
test: hash_index
75+
test: update
7576
test: privileges
7677
test: misc
7778
test: select_views

src/test/regress/sql/update.sql

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--
2+
-- UPDATE ... SET <col> = DEFAULT;
3+
--
4+
5+
CREATE TABLE update_test (
6+
a INT DEFAULT 10,
7+
b INT
8+
);
9+
10+
INSERT INTO update_test VALUES (5, 10);
11+
INSERT INTO update_test VALUES (10, 15);
12+
13+
SELECT * FROM update_test;
14+
15+
UPDATE update_test SET a = DEFAULT, b = DEFAULT;
16+
17+
SELECT * FROM update_test;
18+
19+
DROP TABLE update_test;

0 commit comments

Comments
 (0)