Improve portability of test with oid8 comparison function
authorMichael Paquier <michael@paquier.xyz>
Wed, 7 Jan 2026 03:55:16 +0000 (12:55 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 7 Jan 2026 03:55:16 +0000 (12:55 +0900)
Oversight in b139bd3b6ef0, per reports from buildfarm members longfin
and prion, that use -DSTRESS_SORT_INT_MIN.  Thanks to Tom Lane for the
poke.

Discussion: https://postgr.es/m/1656709.1767754981@sss.pgh.pa.us

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

index 3689d21e7c50083078e113e070bae3131aaf6b32..2e114f1ce7020c1f8dd0f48d35bf9e77468c8427 100644 (file)
@@ -344,22 +344,22 @@ SELECT DISTINCT (i || '000000000000' || j)::oid8 f
 (100 rows)
 
 -- 3-way compare for btrees
-SELECT btoid8cmp(1::oid8, 2::oid8);
- btoid8cmp 
+SELECT btoid8cmp(1::oid8, 2::oid8) < 0 AS val_lower;
+ val_lower 
 -----------
-        -1
+ t
 (1 row)
 
-SELECT btoid8cmp(2::oid8, 2::oid8);
- btoid8cmp 
+SELECT btoid8cmp(2::oid8, 2::oid8) = 0 AS val_equal;
+ val_equal 
 -----------
-         0
+ t
 (1 row)
 
-SELECT btoid8cmp(2::oid8, 1::oid8);
- btoid8cmp 
------------
-         1
+SELECT btoid8cmp(2::oid8, 1::oid8) > 0 AS val_higher;
+ val_higher 
+------------
+ t
 (1 row)
 
 -- oid8 has btree and hash opclasses
index 8bfaff01f121c299602f33917df568d13f18c273..44cb79dd5528a1982cc94cb296b5629f7fc4652b 100644 (file)
@@ -76,9 +76,9 @@ SELECT DISTINCT (i || '000000000000' || j)::oid8 f
   ORDER BY f;
 
 -- 3-way compare for btrees
-SELECT btoid8cmp(1::oid8, 2::oid8);
-SELECT btoid8cmp(2::oid8, 2::oid8);
-SELECT btoid8cmp(2::oid8, 1::oid8);
+SELECT btoid8cmp(1::oid8, 2::oid8) < 0 AS val_lower;
+SELECT btoid8cmp(2::oid8, 2::oid8) = 0 AS val_equal;
+SELECT btoid8cmp(2::oid8, 1::oid8) > 0 AS val_higher;
 
 -- oid8 has btree and hash opclasses
 CREATE INDEX on OID8_TBL USING btree(f1);