mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
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
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user