Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Improve stability of identity.sql regression test.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Oct 2020 00:45:06 +0000 (20:45 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Oct 2020 00:45:36 +0000 (20:45 -0400)
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.

src/test/regress/expected/identity.out
src/test/regress/sql/identity.sql

index 2286519b0cae52a27cb3c75a92172d90ee75bd34..de337d83d75ea996cf38863b40bad8234e9570b7 100644 (file)
@@ -316,7 +316,7 @@ SELECT * FROM itest6;
  102 | 
 (3 rows)
 
-SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6';
+SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6' ORDER BY 1, 2;
  table_name | column_name | is_identity | identity_generation 
 ------------+-------------+-------------+---------------------
  itest6     | a           | YES         | BY DEFAULT
index 8dcfdf3dc1510097e613576254b7698d843ffceb..40aaf6163d9dd1b0c669f535f92252b4768fe3b3 100644 (file)
@@ -191,7 +191,7 @@ INSERT INTO itest6 DEFAULT VALUES;
 INSERT INTO itest6 DEFAULT VALUES;
 SELECT * FROM itest6;
 
-SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6';
+SELECT table_name, column_name, is_identity, identity_generation FROM information_schema.columns WHERE table_name = 'itest6' ORDER BY 1, 2;
 
 ALTER TABLE itest6 ALTER COLUMN b SET INCREMENT BY 2;  -- fail, not identity