Skip to content

Commit 74ce5c9

Browse files
committed
Make cluster regress test functional.
1 parent 13e838f commit 74ce5c9

File tree

4 files changed

+57
-10
lines changed

4 files changed

+57
-10
lines changed

src/test/regress/output/cluster.out renamed to src/test/regress/expected/cluster.out

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,49 @@ SELECT * from clstr_tst ORDER BY c;
204204
8 | 21 | veintiuno
205205
(32 rows)
206206

207+
-- Verify that inheritance link still works
208+
INSERT INTO clstr_tst_inh VALUES (0, 100, 'in child table');
209+
SELECT * from clstr_tst;
210+
a | b | c
211+
----+-----+----------------
212+
10 | 14 | catorce
213+
18 | 5 | cinco
214+
9 | 4 | cuatro
215+
26 | 19 | diecinueve
216+
12 | 18 | dieciocho
217+
30 | 16 | dieciseis
218+
24 | 17 | diecisiete
219+
2 | 10 | diez
220+
23 | 12 | doce
221+
11 | 2 | dos
222+
25 | 9 | nueve
223+
31 | 8 | ocho
224+
1 | 11 | once
225+
28 | 15 | quince
226+
32 | 6 | seis
227+
29 | 7 | siete
228+
15 | 13 | trece
229+
22 | 30 | treinta
230+
17 | 32 | treinta y dos
231+
3 | 31 | treinta y uno
232+
5 | 3 | tres
233+
20 | 1 | uno
234+
6 | 20 | veinte
235+
14 | 25 | veinticinco
236+
21 | 24 | veinticuatro
237+
4 | 22 | veintidos
238+
19 | 29 | veintinueve
239+
16 | 28 | veintiocho
240+
27 | 26 | veintiseis
241+
13 | 27 | veintisiete
242+
7 | 23 | veintitres
243+
8 | 21 | veintiuno
244+
0 | 100 | in child table
245+
(33 rows)
246+
247+
-- Verify that foreign key link still works
248+
INSERT INTO clstr_tst (b, c) VALUES (1111, 'this should fail');
249+
ERROR: clstr_tst_con referential integrity violation - key referenced from clstr_tst not found in clstr_tst_s
207250
SELECT conname FROM pg_constraint WHERE conrelid=(SELECT oid FROM pg_class
208251
WHERE relname='clstr_tst');
209252
conname
@@ -228,5 +271,3 @@ SELECT relname FROM pg_class WHERE relname LIKE 'clstr_tst%' ORDER BY relname;
228271
clstr_tst_s_rf_a_seq
229272
(11 rows)
230273

231-
DROP TABLE clstr_tst_inh;
232-
DROP TABLE clstr_tst;

src/test/regress/parallel_schedule

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ test: sanity_check
5555
# ----------
5656
test: errors
5757
test: select
58+
ignore: random
5859

5960
# ----------
6061
# The fourth group of parallel test
6162
# ----------
62-
ignore: random
6363
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
6464

6565
test: privileges
@@ -68,11 +68,10 @@ test: misc
6868
# ----------
6969
# The fifth group of parallel test
7070
# ----------
71-
test: select_views alter_table portals_p2 rules foreign_key
71+
test: select_views alter_table portals_p2 rules foreign_key cluster
7272

7373
# ----------
7474
# The sixth group of parallel test
7575
# ----------
7676
# "plpgsql" cannot run concurrently with "rules"
77-
test: limit plpgsql temp domain rangefuncs copy2 conversion
78-
test: without_oid
77+
test: limit plpgsql temp domain rangefuncs copy2 conversion without_oid

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.14 2002/07/25 10:07:13 ishii Exp $
1+
# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.15 2002/08/11 02:06:32 tgl Exp $
22
# This should probably be in an order similar to parallel_schedule.
33
test: boolean
44
test: char
@@ -79,6 +79,7 @@ test: alter_table
7979
test: portals_p2
8080
test: rules
8181
test: foreign_key
82+
test: cluster
8283
test: limit
8384
test: plpgsql
8485
test: copy2

src/test/regress/sql/cluster.sql

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,15 @@ SELECT * from clstr_tst ORDER BY a;
6464
SELECT * from clstr_tst ORDER BY b;
6565
SELECT * from clstr_tst ORDER BY c;
6666

67+
-- Verify that inheritance link still works
68+
INSERT INTO clstr_tst_inh VALUES (0, 100, 'in child table');
69+
SELECT * from clstr_tst;
70+
71+
-- Verify that foreign key link still works
72+
INSERT INTO clstr_tst (b, c) VALUES (1111, 'this should fail');
73+
6774
SELECT conname FROM pg_constraint WHERE conrelid=(SELECT oid FROM pg_class
6875
WHERE relname='clstr_tst');
69-
SELECT relname FROM pg_class WHERE relname LIKE 'clstr_tst%' ORDER BY relname;
7076

71-
DROP TABLE clstr_tst_inh;
72-
DROP TABLE clstr_tst;
77+
78+
SELECT relname FROM pg_class WHERE relname LIKE 'clstr_tst%' ORDER BY relname;

0 commit comments

Comments
 (0)