Skip to content

Commit e5209bf

Browse files
committed
Try to stabilize output from rolenames regression test.
It's not quite clear why commit 45b9805 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
1 parent 1ed6b89 commit e5209bf

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/modules/unsafe_tests/expected/rolenames.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE OR REPLACE FUNCTION chkrolattr()
1+
CREATE FUNCTION chkrolattr()
22
RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
33
AS $$
44
SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@@ -13,9 +13,9 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
1313
('None', '-'))
1414
AS v(uname, keyword)
1515
ON (r.rolname = v.uname)
16-
ORDER BY 1;
16+
ORDER BY 1, 2;
1717
$$ LANGUAGE SQL;
18-
CREATE OR REPLACE FUNCTION chksetconfig()
18+
CREATE FUNCTION chksetconfig()
1919
RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
2020
AS $$
2121
SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@@ -31,14 +31,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
3131
WHERE (r.rolname) IN ('Public', 'current_user', 'regress_testrol1', 'regress_testrol2')
3232
ORDER BY 1, 2;
3333
$$ LANGUAGE SQL;
34-
CREATE OR REPLACE FUNCTION chkumapping()
34+
CREATE FUNCTION chkumapping()
3535
RETURNS TABLE (umname name, umserver name, umoptions text[])
3636
AS $$
3737
SELECT r.rolname, s.srvname, m.umoptions
3838
FROM pg_user_mapping m
3939
LEFT JOIN pg_roles r ON (r.oid = m.umuser)
4040
JOIN pg_foreign_server s ON (s.oid = m.umserver)
41-
ORDER BY 2;
41+
ORDER BY 2, 1;
4242
$$ LANGUAGE SQL;
4343
--
4444
-- We test creation and use of these role names to ensure that the server

src/test/modules/unsafe_tests/sql/rolenames.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE OR REPLACE FUNCTION chkrolattr()
1+
CREATE FUNCTION chkrolattr()
22
RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
33
AS $$
44
SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@@ -13,10 +13,10 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
1313
('None', '-'))
1414
AS v(uname, keyword)
1515
ON (r.rolname = v.uname)
16-
ORDER BY 1;
16+
ORDER BY 1, 2;
1717
$$ LANGUAGE SQL;
1818

19-
CREATE OR REPLACE FUNCTION chksetconfig()
19+
CREATE FUNCTION chksetconfig()
2020
RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
2121
AS $$
2222
SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@@ -33,14 +33,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
3333
ORDER BY 1, 2;
3434
$$ LANGUAGE SQL;
3535

36-
CREATE OR REPLACE FUNCTION chkumapping()
36+
CREATE FUNCTION chkumapping()
3737
RETURNS TABLE (umname name, umserver name, umoptions text[])
3838
AS $$
3939
SELECT r.rolname, s.srvname, m.umoptions
4040
FROM pg_user_mapping m
4141
LEFT JOIN pg_roles r ON (r.oid = m.umuser)
4242
JOIN pg_foreign_server s ON (s.oid = m.umserver)
43-
ORDER BY 2;
43+
ORDER BY 2, 1;
4444
$$ LANGUAGE SQL;
4545

4646
--

0 commit comments

Comments
 (0)