mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Initialize pad bytes in GinFormTuple().
Every other core buffer page consumer initializes the bytes it furnishes to PageAddItem(). For consistency, do the same here. No back-patch; regardless, we couldn't count on the fix so long as binary upgrade can carry forward affected index builds.
This commit is contained in:
parent
d53f7cf116
commit
1d96bb9602
@ -112,6 +112,12 @@ GinFormTuple(GinState *ginstate,
|
|||||||
if (newsize != IndexTupleSize(itup))
|
if (newsize != IndexTupleSize(itup))
|
||||||
{
|
{
|
||||||
itup = repalloc(itup, newsize);
|
itup = repalloc(itup, newsize);
|
||||||
|
/*
|
||||||
|
* PostgreSQL 9.3 and earlier did not clear this new space, so we
|
||||||
|
* might find uninitialized padding when reading tuples from disk.
|
||||||
|
*/
|
||||||
|
memset((char *) itup + IndexTupleSize(itup),
|
||||||
|
0, newsize - IndexTupleSize(itup));
|
||||||
|
|
||||||
/* set new size in tuple header */
|
/* set new size in tuple header */
|
||||||
itup->t_info &= ~INDEX_SIZE_MASK;
|
itup->t_info &= ~INDEX_SIZE_MASK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user