From 3e23b68dac006e8deb0afa327e855258df8de064 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 6 Apr 2007 04:21:44 +0000 Subject: Support varlena fields with single-byte headers and unaligned storage. This commit breaks any code that assumes that the mere act of forming a tuple (without writing it to disk) does not "toast" any fields. While all available regression tests pass, I'm not totally sure that we've fixed every nook and cranny, especially in contrib. Greg Stark with some help from Tom Lane --- src/backend/utils/adt/datum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/datum.c') diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c index 21e7cc55412..c025de61f74 100644 --- a/src/backend/utils/adt/datum.c +++ b/src/backend/utils/adt/datum.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/datum.c,v 1.34 2007/02/27 23:48:07 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/datum.c,v 1.35 2007/04/06 04:21:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ * Find the "real" size of a datum, given the datum value, * whether it is a "by value", and the declared type length. * - * This is essentially an out-of-line version of the att_addlength() + * This is essentially an out-of-line version of the att_addlength_datum() * macro in access/tupmacs.h. We do a tad more error checking though. *------------------------------------------------------------------------- */ @@ -79,7 +79,7 @@ datumGetSize(Datum value, bool typByVal, int typLen) (errcode(ERRCODE_DATA_EXCEPTION), errmsg("invalid Datum pointer"))); - size = (Size) VARSIZE(s); + size = (Size) VARSIZE_ANY(s); } else if (typLen == -2) { -- cgit v1.2.3