Skip to content

Commit 5ad966a

Browse files
committed
Fix some more regression test row-order-instability issues.
Commit 0563a3a just introduced another instance of the same unsafe testing methodology that appeared in 2ac3ef7, which I corrected in 257d815. Robert/Amit, please stop doing that. Also look through the rest of f0e4475's test cases, and correct some other queries with underdetermined ordering of results from the system catalogs. These haven't failed in the buildfarm yet, but I don't have any confidence in that staying true. Per multiple buildfarm members.
1 parent 5b29e6b commit 5ad966a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/test/regress/expected/alter_table.out

+2-1
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,8 @@ from pg_attribute
33533353
where attname = 'a'
33543354
and (attrelid = 'p'::regclass
33553355
or attrelid = 'p1'::regclass
3356-
or attrelid = 'p11'::regclass);
3356+
or attrelid = 'p11'::regclass)
3357+
order by attrelid::regclass::text;
33573358
attrelid | attname | attnum
33583359
----------+---------+--------
33593360
p | a | 1

src/test/regress/expected/create_table.out

+6-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ SELECT relkind FROM pg_class WHERE relname = 'partitioned';
400400
(1 row)
401401

402402
-- check that range partition key columns are marked NOT NULL
403-
SELECT attname, attnotnull FROM pg_attribute WHERE attrelid = 'partitioned'::regclass AND attnum > 0;
403+
SELECT attname, attnotnull FROM pg_attribute
404+
WHERE attrelid = 'partitioned'::regclass AND attnum > 0
405+
ORDER BY attnum;
404406
attname | attnotnull
405407
---------+------------
406408
a | t
@@ -575,7 +577,9 @@ CREATE TABLE parted (
575577
) PARTITION BY LIST (a);
576578
CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
577579
-- only inherited attributes (never local ones)
578-
SELECT attname, attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_a'::regclass and attnum > 0;
580+
SELECT attname, attislocal, attinhcount FROM pg_attribute
581+
WHERE attrelid = 'part_a'::regclass and attnum > 0
582+
ORDER BY attnum;
579583
attname | attislocal | attinhcount
580584
---------+------------+-------------
581585
a | f | 1

src/test/regress/sql/alter_table.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,8 @@ from pg_attribute
22062206
where attname = 'a'
22072207
and (attrelid = 'p'::regclass
22082208
or attrelid = 'p1'::regclass
2209-
or attrelid = 'p11'::regclass);
2209+
or attrelid = 'p11'::regclass)
2210+
order by attrelid::regclass::text;
22102211

22112212
alter table p1 attach partition p11 for values from (2) to (5);
22122213

src/test/regress/sql/create_table.sql

+6-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ CREATE TABLE partitioned (
403403
SELECT relkind FROM pg_class WHERE relname = 'partitioned';
404404

405405
-- check that range partition key columns are marked NOT NULL
406-
SELECT attname, attnotnull FROM pg_attribute WHERE attrelid = 'partitioned'::regclass AND attnum > 0;
406+
SELECT attname, attnotnull FROM pg_attribute
407+
WHERE attrelid = 'partitioned'::regclass AND attnum > 0
408+
ORDER BY attnum;
407409

408410
-- prevent a function referenced in partition key from being dropped
409411
DROP FUNCTION plusone(int);
@@ -548,7 +550,9 @@ CREATE TABLE parted (
548550
CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
549551

550552
-- only inherited attributes (never local ones)
551-
SELECT attname, attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_a'::regclass and attnum > 0;
553+
SELECT attname, attislocal, attinhcount FROM pg_attribute
554+
WHERE attrelid = 'part_a'::regclass and attnum > 0
555+
ORDER BY attnum;
552556

553557
-- able to specify column default, column constraint, and table constraint
554558
CREATE TABLE part_b PARTITION OF parted (

0 commit comments

Comments
 (0)