Skip to content
Snippets Groups Projects
Commit c67f6f2f authored by Tom Lane's avatar Tom Lane
Browse files

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).
parent 2d2b0222
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.82 2008/02/23 19:11:45 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.83 2008/02/29 17:47:41 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -1093,7 +1093,8 @@ toast_save_datum(Relation rel, Datum value, ...@@ -1093,7 +1093,8 @@ toast_save_datum(Relation rel, Datum value,
struct struct
{ {
struct varlena hdr; 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; } chunk_data;
int32 chunk_size; int32 chunk_size;
int32 chunk_seq = 0; int32 chunk_seq = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment