Fix query checking consistency of table amhandlers in opr_sanity.sql
authorMichael Paquier <[email protected]>
Wed, 22 Nov 2023 00:32:37 +0000 (09:32 +0900)
committerMichael Paquier <[email protected]>
Wed, 22 Nov 2023 00:32:37 +0000 (09:32 +0900)
As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

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

index 2fdfc7ba8bd87d6360a055a446f285bccf22cb0e..727a40e376bb226d2ec3317ce9a116206e0edc4b 100644 (file)
@@ -1903,7 +1903,7 @@ WHERE p2.oid = p1.amhandler AND p1.amtype = 'i' AND
 -- Check for table amhandler functions with the wrong signature
 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
+WHERE p2.oid = p1.amhandler AND p1.amtype = 't' AND
     (p2.prorettype != 'table_am_handler'::regtype
      OR p2.proretset
      OR p2.pronargs != 1
index 7a9180b081524da30b4598eb0fd87fb59e1f1b62..6879545ae446c0b04e831a3eb8d8558a312d830b 100644 (file)
@@ -1244,7 +1244,7 @@ WHERE p2.oid = p1.amhandler AND p1.amtype = 'i' AND
 
 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
+WHERE p2.oid = p1.amhandler AND p1.amtype = 't' AND
     (p2.prorettype != 'table_am_handler'::regtype
      OR p2.proretset
      OR p2.pronargs != 1