Skip to content

Commit db7c7b8

Browse files
committed
Improve stability of identity.sql regression test.
I noticed while trying to run the regression tests under a low geqo_threshold that one query on information_schema.columns had unstable (as in, variable from one run to the next) output order. This is pretty unsurprising given the complexity of the underlying plan. Interestingly, of this test's three nigh-identical queries on information_schema.columns, the other two already had ORDER BY clauses guaranteeing stable output. Let's make this one look the same. Back-patch to v10 where this test was added. We've not heard field reports of the test failing, but this experience shows that it can happen when testing under even slightly unusual conditions.
1 parent 65aa18e commit db7c7b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/regress/expected/identity.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ SELECT * FROM itest6;
303303
102 |
304304
(3 rows)
305305

306-
SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6';
306+
SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6' ORDER BY 1, 2;
307307
table_name | column_name | is_identity | identity_generation
308308
------------+-------------+-------------+---------------------
309309
itest6 | a | YES | BY DEFAULT

src/test/regress/sql/identity.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ INSERT INTO itest6 DEFAULT VALUES;
183183
INSERT INTO itest6 DEFAULT VALUES;
184184
SELECT * FROM itest6;
185185

186-
SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6';
186+
SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6' ORDER BY 1, 2;
187187

188188
ALTER TABLE itest6 ALTER COLUMN b SET INCREMENT BY 2; -- fail, not identity
189189

0 commit comments

Comments
 (0)