aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/array_userfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-14 02:09:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-14 02:09:52 +0000
commit81e11f2d056c7966ce6ae54f41026434e2eb3b28 (patch)
tree423b95f916062d6c75aef060cbcb47698c752e7f /src/backend/utils/adt/array_userfuncs.c
parent03e5248d0f09f46b2fcaff266e7b2f0f997d6cfd (diff)
downloadpostgresql-81e11f2d056c7966ce6ae54f41026434e2eb3b28.tar.gz
postgresql-81e11f2d056c7966ce6ae54f41026434e2eb3b28.zip
Actually, instead of whining about how type internal might not safely store
a pointer, why don't we just fix that. Every known use of "internal" really means a pointer anyway.
Diffstat (limited to 'src/backend/utils/adt/array_userfuncs.c')
-rw-r--r--src/backend/utils/adt/array_userfuncs.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/backend/utils/adt/array_userfuncs.c b/src/backend/utils/adt/array_userfuncs.c
index 6f18c664059..4c147f0021d 100644
--- a/src/backend/utils/adt/array_userfuncs.c
+++ b/src/backend/utils/adt/array_userfuncs.c
@@ -6,7 +6,7 @@
* Copyright (c) 2003-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.25 2008/11/14 00:12:08 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.26 2008/11/14 02:09:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -495,14 +495,10 @@ array_agg_transfn(PG_FUNCTION_ARGS)
((AggState *) fcinfo->context)->aggcontext);
/*
- * We cheat quite a lot here by assuming that a pointer datum will be
- * preserved intact when nodeAgg.c thinks it is a value of type "internal".
- * This will in fact work because internal is stated to be pass-by-value
- * in pg_type.h, and nodeAgg will never do anything with a pass-by-value
- * transvalue except pass it around in Datum form. But it's mighty
- * shaky seeing that internal is also stated to be 4 bytes wide in
- * pg_type.h. If nodeAgg did put the value into a tuple this would
- * crash and burn on 64-bit machines.
+ * The transition type for array_agg() is declared to be "internal",
+ * which is a pass-by-value type the same size as a pointer. So we
+ * can safely pass the ArrayBuildState pointer through nodeAgg.c's
+ * machinations.
*/
PG_RETURN_POINTER(state);
}