diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-02-29 17:47:47 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-02-29 17:47:47 +0000 |
commit | c6f401573f1c439f018849131ac18f8199f7085c (patch) | |
tree | 3f8b0f417f6cb891e64dcb0078c44bcce86ada81 /src | |
parent | b7394915520b29fb2d164ad4c55fd9adf51c14df (diff) | |
download | postgresql-c6f401573f1c439f018849131ac18f8199f7085c.tar.gz postgresql-c6f401573f1c439f018849131ac18f8199f7085c.zip |
Reducing the assumed alignment of struct varlena means that the compiler
is also licensed to put a local variable declared that way at an unaligned
address. Which will not work if the variable is then manipulated with
SET_VARSIZE or other macros that assume alignment. So the previous patch
is not an unalloyed good, but on balance I think it's still a win, since
we have very few places that do that sort of thing. Fix the one place in
tuptoaster.c that does it. Per buildfarm results from gypsy_moth
(I'm a bit surprised that only one machine showed a failure).
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/heap/tuptoaster.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index e729e77a54e..a211c0b9e40 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.81.2.1 2008/02/23 19:11:55 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.81.2.2 2008/02/29 17:47:47 tgl Exp $ * * * INTERFACE ROUTINES @@ -1093,7 +1093,8 @@ toast_save_datum(Relation rel, Datum value, struct { struct varlena hdr; - char data[TOAST_MAX_CHUNK_SIZE]; + char data[TOAST_MAX_CHUNK_SIZE]; /* make struct big enough */ + int32 align_it; /* ensure struct is aligned well enough */ } chunk_data; int32 chunk_size; int32 chunk_seq = 0; |