Skip to content

Commit c6dc6a0

Browse files
committed
Use ORDER BY in catalog results in SQL/JSON tests
The buildfarm has revealed some instability in results from catalog queries in tests from commit 1a36bc9. Cure this by adding ORDER BY to such queries.
1 parent 6974924 commit c6dc6a0

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/test/regress/expected/jsonb_sqljson.out

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,18 +949,22 @@ Check constraints:
949949

950950
SELECT check_clause
951951
FROM information_schema.check_constraints
952-
WHERE constraint_name LIKE 'test_jsonb_constraint%';
952+
WHERE constraint_name LIKE 'test_jsonb_constraint%'
953+
ORDER BY 1;
953954
check_clause
954955
--------------------------------------------------------------------------------------------------------------------------
956+
((JSON_EXISTS((js)::jsonb, 'strict $."a"' RETURNING integer TRUE ON ERROR) < 2))
957+
((JSON_QUERY((js)::jsonb, '$."a"' RETURNING character(5) OMIT QUOTES EMPTY ARRAY ON EMPTY) > ('a'::bpchar COLLATE "C")))
958+
((JSON_QUERY((js)::jsonb, '$."a"' RETURNING jsonb WITH CONDITIONAL WRAPPER EMPTY OBJECT ON ERROR) < '[10]'::jsonb))
959+
((JSON_VALUE((js)::jsonb, '$."a"' RETURNING integer DEFAULT (('12'::text || i))::integer ON EMPTY ERROR ON ERROR) > i))
955960
((js IS JSON))
956961
(JSON_EXISTS((js)::jsonb, '$."a"' PASSING (i + 5) AS int, (i)::text AS txt, ARRAY[1, 2, 3] AS arr))
957-
((JSON_VALUE((js)::jsonb, '$."a"' RETURNING integer DEFAULT (('12'::text || i))::integer ON EMPTY ERROR ON ERROR) > i))
958-
((JSON_QUERY((js)::jsonb, '$."a"' RETURNING jsonb WITH CONDITIONAL WRAPPER EMPTY OBJECT ON ERROR) < '[10]'::jsonb))
959-
((JSON_QUERY((js)::jsonb, '$."a"' RETURNING character(5) OMIT QUOTES EMPTY ARRAY ON EMPTY) > ('a'::bpchar COLLATE "C")))
960-
((JSON_EXISTS((js)::jsonb, 'strict $."a"' RETURNING integer TRUE ON ERROR) < 2))
961962
(6 rows)
962963

963-
SELECT pg_get_expr(adbin, adrelid) FROM pg_attrdef WHERE adrelid = 'test_jsonb_constraints'::regclass;
964+
SELECT pg_get_expr(adbin, adrelid)
965+
FROM pg_attrdef
966+
WHERE adrelid = 'test_jsonb_constraints'::regclass
967+
ORDER BY 1;
964968
pg_get_expr
965969
--------------------------------------------------------------------------------
966970
JSON_QUERY('[1, 2]'::jsonb, '$[*]' RETURNING jsonb WITH UNCONDITIONAL WRAPPER)

src/test/regress/sql/jsonb_sqljson.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,13 @@ CREATE TABLE test_jsonb_constraints (
280280

281281
SELECT check_clause
282282
FROM information_schema.check_constraints
283-
WHERE constraint_name LIKE 'test_jsonb_constraint%';
283+
WHERE constraint_name LIKE 'test_jsonb_constraint%'
284+
ORDER BY 1;
284285

285-
SELECT pg_get_expr(adbin, adrelid) FROM pg_attrdef WHERE adrelid = 'test_jsonb_constraints'::regclass;
286+
SELECT pg_get_expr(adbin, adrelid)
287+
FROM pg_attrdef
288+
WHERE adrelid = 'test_jsonb_constraints'::regclass
289+
ORDER BY 1;
286290

287291
INSERT INTO test_jsonb_constraints VALUES ('', 1);
288292
INSERT INTO test_jsonb_constraints VALUES ('1', 1);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy