OSDN Git Service

Fix a serious bug introduced into GIN in 8.4: now that MergeItemPointers()
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Jun 2009 02:39:40 +0000 (02:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Jun 2009 02:39:40 +0000 (02:39 +0000)
commit356eea24ce6f5e0875b85e938230cfd01ed75ae3
tree36d3e14da16b0ef91998fda4587b750308251149
parent1978d7f13fc2c46c74bf60ee84a5a8557391e53b
Fix a serious bug introduced into GIN in 8.4: now that MergeItemPointers()
is supposed to remove duplicate heap TIDs, we have to be sure to reduce the
tuple size and posting-item count accordingly in addItemPointersToTuple().
Failing to do so resulted in the effective injection of garbage TIDs into the
index contents, ie, whatever happened to be in the memory palloc'd for the
new tuple.  I'm not sure that this fully explains the index corruption
reported by Tatsuo Ishii, but the test case I'm using no longer fails.
src/backend/access/gin/gindatapage.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/gininsert.c
src/include/access/gin.h