summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-01-23 20:58:12 +0000
committerHeikki Linnakangas2014-01-23 20:58:12 +0000
commitec8f692c3cd5760435712b7ec4afa8f014ed7b2e (patch)
tree8852a19765f7e5a2633e8d091bfafa82c0a06db5
parent0fdb2f7d7c0059a1621710206ed506124cf98f77 (diff)
Fix alignment of GIN in-line posting lists stored in entry tuples.
The Sparc machines in the buildfarm are crashing because of misaligned access to posting lists stored in entry tuples. I accidentally removed a critical SHORTALIGN() from ginFormTuple, as part of the packed posting lists patch. Perhaps I thought it was unnecessary, because the index_form_tuple() call above the SHORTALIGN already aligned the size, missing the fact that the null-category byte makes it misaligned again (I think the SHORTALIGN is indeed unnecessary if there's no null- category byte, but let's just play it safe...)
-rw-r--r--src/backend/access/gin/ginentrypage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/access/gin/ginentrypage.c b/src/backend/access/gin/ginentrypage.c
index 6f4e727b3e..d5aa243a65 100644
--- a/src/backend/access/gin/ginentrypage.c
+++ b/src/backend/access/gin/ginentrypage.c
@@ -87,6 +87,8 @@ GinFormTuple(GinState *ginstate,
newsize = Max(newsize, minsize);
}
+ newsize = SHORTALIGN(newsize);
+
GinSetPostingOffset(itup, newsize);
GinSetNPosting(itup, nipd);