Browse Source

Try to stabilize output from rolenames regression test.

It's not quite clear why commit 45b980570 has resulted in
some instability here, though interference from concurrent
autovacuum runs seems like a reasonable guess.  What is
clear is that the output ordering of the test queries is
underdetermined for no very good reason.  Extend the
ORDER BY keys in hopes of fixing the buildfarm.

Discussion: https://postgr.es/m/147499.1600351924@sss.pgh.pa.us
master
Tom Lane 1 month ago
parent
commit
e5209bf37a
2 changed files with 10 additions and 10 deletions
  1. +5
    -5
      src/test/modules/unsafe_tests/expected/rolenames.out
  2. +5
    -5
      src/test/modules/unsafe_tests/sql/rolenames.sql

+ 5
- 5
src/test/modules/unsafe_tests/expected/rolenames.out View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION chkrolattr()
CREATE FUNCTION chkrolattr()
RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
AS $$
SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@ -13,9 +13,9 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
('None', '-'))
AS v(uname, keyword)
ON (r.rolname = v.uname)
ORDER BY 1;
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION chksetconfig()
CREATE FUNCTION chksetconfig()
RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
AS $$
SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@ -31,14 +31,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
WHERE (r.rolname) IN ('Public', 'current_user', 'regress_testrol1', 'regress_testrol2')
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION chkumapping()
CREATE FUNCTION chkumapping()
RETURNS TABLE (umname name, umserver name, umoptions text[])
AS $$
SELECT r.rolname, s.srvname, m.umoptions
FROM pg_user_mapping m
LEFT JOIN pg_roles r ON (r.oid = m.umuser)
JOIN pg_foreign_server s ON (s.oid = m.umserver)
ORDER BY 2;
ORDER BY 2, 1;
$$ LANGUAGE SQL;
--
-- We test creation and use of these role names to ensure that the server

+ 5
- 5
src/test/modules/unsafe_tests/sql/rolenames.sql View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION chkrolattr()
CREATE FUNCTION chkrolattr()
RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
AS $$
SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@ -13,10 +13,10 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
('None', '-'))
AS v(uname, keyword)
ON (r.rolname = v.uname)
ORDER BY 1;
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION chksetconfig()
CREATE FUNCTION chksetconfig()
RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
AS $$
SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@ -33,14 +33,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION chkumapping()
CREATE FUNCTION chkumapping()
RETURNS TABLE (umname name, umserver name, umoptions text[])
AS $$
SELECT r.rolname, s.srvname, m.umoptions
FROM pg_user_mapping m
LEFT JOIN pg_roles r ON (r.oid = m.umuser)
JOIN pg_foreign_server s ON (s.oid = m.umserver)
ORDER BY 2;
ORDER BY 2, 1;
$$ LANGUAGE SQL;
--

Loading…
Cancel
Save