aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/oid.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-03-02 21:13:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-03-02 21:13:04 +0000
commit9356877bba8fa0fcae8f1450d74e4d17ec9f7f83 (patch)
treef25624e295f1a0330fd73df8d9a63318c2b9584f /src/backend/utils/adt/oid.c
parent487b7f5de3c3b40a54e9520c1708165784f1c6c6 (diff)
downloadpostgresql-9356877bba8fa0fcae8f1450d74e4d17ec9f7f83.tar.gz
postgresql-9356877bba8fa0fcae8f1450d74e4d17ec9f7f83.zip
Repair oidvectorrecv and int2vectorrecv, which I broke while changing
them to use array_recv :-(. Per report from Tim Kordas.
Diffstat (limited to 'src/backend/utils/adt/oid.c')
-rw-r--r--src/backend/utils/adt/oid.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/backend/utils/adt/oid.c b/src/backend/utils/adt/oid.c
index c31dbf4f666..9129bebea3c 100644
--- a/src/backend/utils/adt/oid.c
+++ b/src/backend/utils/adt/oid.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.66 2005/11/22 18:17:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.67 2006/03/02 21:13:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -254,13 +254,28 @@ Datum
oidvectorrecv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
+ FunctionCallInfoData locfcinfo;
oidvector *result;
- result = (oidvector *)
- DatumGetPointer(DirectFunctionCall3(array_recv,
- PointerGetDatum(buf),
- ObjectIdGetDatum(OIDOID),
- Int32GetDatum(-1)));
+ /*
+ * Normally one would call array_recv() using DirectFunctionCall3,
+ * but that does not work since array_recv wants to cache some data
+ * using fcinfo->flinfo->fn_extra. So we need to pass it our own
+ * flinfo parameter.
+ */
+ InitFunctionCallInfoData(locfcinfo, fcinfo->flinfo, 3, NULL, NULL);
+
+ locfcinfo.arg[0] = PointerGetDatum(buf);
+ locfcinfo.arg[1] = ObjectIdGetDatum(OIDOID);
+ locfcinfo.arg[2] = Int32GetDatum(-1);
+ locfcinfo.argnull[0] = false;
+ locfcinfo.argnull[1] = false;
+ locfcinfo.argnull[2] = false;
+
+ result = (oidvector *) DatumGetPointer(array_recv(&locfcinfo));
+
+ Assert(!locfcinfo.isnull);
+
/* sanity checks: oidvector must be 1-D, no nulls */
if (ARR_NDIM(result) != 1 ||
ARR_HASNULL(result) ||