aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-12-15 07:49:30 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-12-15 07:54:48 +0100
commit2613dec4ed67c4a963d987cbd29284e0634b65c9 (patch)
tree3788dd8083eacb5c7a2958e5e2f2809357f2dfe7
parent3b9d2deb67a0d5ee681561fc0e07c2dca4e26e96 (diff)
downloadpostgresql-2613dec4ed67c4a963d987cbd29284e0634b65c9.tar.gz
postgresql-2613dec4ed67c4a963d987cbd29284e0634b65c9.zip
Move provariadic sanity check to a more appropriate place
35f059e9bdfb3b14ac9d22a9e159d36ec0ccf804 put the provariadic sanity check into type_sanity.sql, even though it's not about types, and moreover in the middle of some connected test group, which makes it all very confusing. Move it to opr_sanity.sql, where it is in better company.
-rw-r--r--src/test/regress/expected/opr_sanity.out31
-rw-r--r--src/test/regress/expected/type_sanity.out31
-rw-r--r--src/test/regress/sql/opr_sanity.sql26
-rw-r--r--src/test/regress/sql/type_sanity.sql26
4 files changed, 57 insertions, 57 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 330eb0f7656..02f5348ab1b 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -472,6 +472,37 @@ WHERE proallargtypes IS NOT NULL AND
-----+---------+-------------+----------------+-------------
(0 rows)
+-- Check for type of the variadic array parameter's elements.
+-- provariadic should be ANYOID if the type of the last element is ANYOID,
+-- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
+-- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
+-- and otherwise the element type corresponding to the array type.
+SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
+FROM pg_proc
+WHERE provariadic != 0
+AND case proargtypes[array_length(proargtypes, 1)-1]
+ WHEN '"any"'::regtype THEN '"any"'::regtype
+ WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
+ WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
+ ELSE (SELECT t.oid
+ FROM pg_type t
+ WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
+ END != provariadic;
+ oid | provariadic | proargtypes
+-----+-------------+-------------
+(0 rows)
+
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+ IS DISTINCT FROM
+ (provariadic != 0);
+ oid | proargmodes | provariadic
+-----+-------------+-------------
+(0 rows)
+
-- Check for prosupport functions with the wrong signature
SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2
diff --git a/src/test/regress/expected/type_sanity.out b/src/test/regress/expected/type_sanity.out
index d3ac08c9ee3..a640cfc4769 100644
--- a/src/test/regress/expected/type_sanity.out
+++ b/src/test/regress/expected/type_sanity.out
@@ -132,37 +132,6 @@ WHERE t1.typinput = p1.oid AND NOT
-----+---------+-----+---------
(0 rows)
--- Check for type of the variadic array parameter's elements.
--- provariadic should be ANYOID if the type of the last element is ANYOID,
--- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
--- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
--- and otherwise the element type corresponding to the array type.
-SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
-FROM pg_proc
-WHERE provariadic != 0
-AND case proargtypes[array_length(proargtypes, 1)-1]
- WHEN '"any"'::regtype THEN '"any"'::regtype
- WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
- WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
- ELSE (SELECT t.oid
- FROM pg_type t
- WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
- END != provariadic;
- oid | provariadic | proargtypes
------+-------------+-------------
-(0 rows)
-
--- Check that all and only those functions with a variadic type have
--- a variadic argument.
-SELECT oid::regprocedure, proargmodes, provariadic
-FROM pg_proc
-WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
- IS DISTINCT FROM
- (provariadic != 0);
- oid | proargmodes | provariadic
------+-------------+-------------
-(0 rows)
-
-- As of 8.0, this check finds refcursor, which is borrowing
-- other types' I/O routines
SELECT t1.oid, t1.typname, p1.oid, p1.proname
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index 2b292851e3a..56b54ba9883 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -344,6 +344,32 @@ WHERE proallargtypes IS NOT NULL AND
FROM generate_series(1, array_length(proallargtypes, 1)) g(i)
WHERE proargmodes IS NULL OR proargmodes[i] IN ('i', 'b', 'v'));
+-- Check for type of the variadic array parameter's elements.
+-- provariadic should be ANYOID if the type of the last element is ANYOID,
+-- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
+-- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
+-- and otherwise the element type corresponding to the array type.
+
+SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
+FROM pg_proc
+WHERE provariadic != 0
+AND case proargtypes[array_length(proargtypes, 1)-1]
+ WHEN '"any"'::regtype THEN '"any"'::regtype
+ WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
+ WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
+ ELSE (SELECT t.oid
+ FROM pg_type t
+ WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
+ END != provariadic;
+
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+ IS DISTINCT FROM
+ (provariadic != 0);
+
-- Check for prosupport functions with the wrong signature
SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2
diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql
index 5edc1f1f6ed..79ec410a6ca 100644
--- a/src/test/regress/sql/type_sanity.sql
+++ b/src/test/regress/sql/type_sanity.sql
@@ -105,32 +105,6 @@ WHERE t1.typinput = p1.oid AND NOT
p1.proargtypes[1] = 'oid'::regtype AND
p1.proargtypes[2] = 'int4'::regtype));
--- Check for type of the variadic array parameter's elements.
--- provariadic should be ANYOID if the type of the last element is ANYOID,
--- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
--- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
--- and otherwise the element type corresponding to the array type.
-
-SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
-FROM pg_proc
-WHERE provariadic != 0
-AND case proargtypes[array_length(proargtypes, 1)-1]
- WHEN '"any"'::regtype THEN '"any"'::regtype
- WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
- WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
- ELSE (SELECT t.oid
- FROM pg_type t
- WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
- END != provariadic;
-
--- Check that all and only those functions with a variadic type have
--- a variadic argument.
-SELECT oid::regprocedure, proargmodes, provariadic
-FROM pg_proc
-WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
- IS DISTINCT FROM
- (provariadic != 0);
-
-- As of 8.0, this check finds refcursor, which is borrowing
-- other types' I/O routines
SELECT t1.oid, t1.typname, p1.oid, p1.proname