Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e10017

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 allowthis 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, andcouldn't see an existing test that it would be appropriateto add to.Neil Conway
1 parent47a4e2e commit1e10017

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

‎src/test/regress/expected/update.out

Lines changed: 25 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--
2+
-- UPDATE ... SET <col> = DEFAULT;
3+
--
4+
5+
CREATETABLEupdate_test (
6+
aINT DEFAULT10,
7+
bINT
8+
);
9+
10+
INSERT INTO update_testVALUES (5,10);
11+
INSERT INTO update_testVALUES (10,15);
12+
13+
SELECT*FROM update_test;
14+
15+
UPDATE update_testSET a= DEFAULT, b= DEFAULT;
16+
17+
SELECT*FROM update_test;
18+
19+
DROPTABLE update_test;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp