Subject: Typo with amtype = 's' in opr_sanity.sql

From: Michael Paquier <[email-masked]>
Date: Tue, 21 Nov 2023 15:09:20 +0900

Hi all,

While rebasing a patch from 2016 related to sequence AMs (more about
that later), I've bumped on a mistake from 8586bf7ed888 in
opr_sanity.sql, as of:
+SELECT p1.oid, p1.amname, p2.oid, p2.proname
+FROM pg_am AS p1, pg_proc AS p2
+WHERE p2.oid = p1.amhandler AND p1.amtype = 's' AND

It seems to me that this has been copy-pasted on HEAD from the
sequence AM patch, but forgot to update amtype to 't'.  While that's
maybe cosmetic, I think that this could lead to unexpected results, so
perhaps there is a point in doing a backpatch?

Thoughts?
--
Michael
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 7a6f36a6a9..7610b011d6 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -1920,7 +1920,7 @@ WHERE p1.oid = a1.amhandler AND a1.amtype = 'i' AND
 -- Check for table amhandler functions with the wrong signature
 SELECT a1.oid, a1.amname, p1.oid, p1.proname
 FROM pg_am AS a1, pg_proc AS p1
-WHERE p1.oid = a1.amhandler AND a1.amtype = 's' AND
+WHERE p1.oid = a1.amhandler AND a1.amtype = 't' AND
     (p1.prorettype != 'table_am_handler'::regtype
      OR p1.proretset
      OR p1.pronargs != 1
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index e2d2c70d70..2fe7b6dcc4 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -1223,7 +1223,7 @@ WHERE p1.oid = a1.amhandler AND a1.amtype = 'i' AND
 
 SELECT a1.oid, a1.amname, p1.oid, p1.proname
 FROM pg_am AS a1, pg_proc AS p1
-WHERE p1.oid = a1.amhandler AND a1.amtype = 's' AND
+WHERE p1.oid = a1.amhandler AND a1.amtype = 't' AND
     (p1.prorettype != 'table_am_handler'::regtype
      OR p1.proretset
      OR p1.pronargs != 1

---

From: Aleksander Alekseev <[email-masked]>
Date: Tue, 21 Nov 2023 13:02:40 +0300

Hi,

> +WHERE p2.oid = p1.amhandler AND p1.amtype = 's' AND

Good catch.

> perhaps there is a point in doing a backpatch?

I disagree that it's cosmetic. The test doesn't check what it's supposed to.

-- 
Best regards,
Aleksander Alekseev

---

From: Michael Paquier <[email-masked]>
Date: Wed, 22 Nov 2023 09:34:24 +0900

> I disagree that it's cosmetic. The test doesn't check what it's supposed to.

Yes, I've backpatched that all the way down to 12 at the end.
--
Michael