aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/utils/adt/array_userfuncs.c6
-rw-r--r--src/test/regress/expected/arrays.out14
-rw-r--r--src/test/regress/sql/arrays.sql9
3 files changed, 27 insertions, 2 deletions
diff --git a/src/backend/utils/adt/array_userfuncs.c b/src/backend/utils/adt/array_userfuncs.c
index 8d6fa41a3c5..9eb678add44 100644
--- a/src/backend/utils/adt/array_userfuncs.c
+++ b/src/backend/utils/adt/array_userfuncs.c
@@ -795,7 +795,8 @@ array_position_common(FunctionCallInfo fcinfo)
format_type_be(element_type))));
my_extra->element_type = element_type;
- fmgr_info(typentry->eq_opr_finfo.fn_oid, &my_extra->proc);
+ fmgr_info_cxt(typentry->eq_opr_finfo.fn_oid, &my_extra->proc,
+ fcinfo->flinfo->fn_mcxt);
}
/* Examine each array element until we find a match. */
@@ -933,7 +934,8 @@ array_positions(PG_FUNCTION_ARGS)
format_type_be(element_type))));
my_extra->element_type = element_type;
- fmgr_info(typentry->eq_opr_finfo.fn_oid, &my_extra->proc);
+ fmgr_info_cxt(typentry->eq_opr_finfo.fn_oid, &my_extra->proc,
+ fcinfo->flinfo->fn_mcxt);
}
/*
diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out
index baccca14afd..59e4472e4fd 100644
--- a/src/test/regress/expected/arrays.out
+++ b/src/test/regress/expected/arrays.out
@@ -589,6 +589,20 @@ SELECT array_positions('[2:4]={1,2,3}'::int[], 1);
{2}
(1 row)
+SELECT
+ array_position(ids, (1, 1)),
+ array_positions(ids, (1, 1))
+ FROM
+(VALUES
+ (ARRAY[(0, 0), (1, 1)]),
+ (ARRAY[(1, 1)])
+) AS f (ids);
+ array_position | array_positions
+----------------+-----------------
+ 2 | {2}
+ 1 | {1}
+(2 rows)
+
-- operators
SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]];
a
diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql
index a2c3db11274..2fbc699f604 100644
--- a/src/test/regress/sql/arrays.sql
+++ b/src/test/regress/sql/arrays.sql
@@ -262,6 +262,15 @@ $$ LANGUAGE plpgsql;
SELECT array_position('[2:4]={1,2,3}'::int[], 1);
SELECT array_positions('[2:4]={1,2,3}'::int[], 1);
+SELECT
+ array_position(ids, (1, 1)),
+ array_positions(ids, (1, 1))
+ FROM
+(VALUES
+ (ARRAY[(0, 0), (1, 1)]),
+ (ARRAY[(1, 1)])
+) AS f (ids);
+
-- operators
SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]];
SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE";