mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
Fix longstanding bug found by Atsushi Ogawa: _bt_check_unique would mark
the wrong buffer dirty when trying to kill a dead index entry that's on a page after the one it started on. No risk of data corruption, just inefficiency, but still a bug.
This commit is contained in:
parent
592ca3cf06
commit
00de66a3b4
1 changed files with 5 additions and 2 deletions
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.119 2004/12/31 21:59:22 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.119.4.1 2005/10/12 17:18:15 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
|
@ -266,7 +266,10 @@ _bt_check_unique(Relation rel, BTItem btitem, Relation heapRel,
|
|||
hbuffer) == HEAPTUPLE_DEAD)
|
||||
{
|
||||
curitemid->lp_flags |= LP_DELETE;
|
||||
SetBufferCommitInfoNeedsSave(buf);
|
||||
if (nbuf != InvalidBuffer)
|
||||
SetBufferCommitInfoNeedsSave(nbuf);
|
||||
else
|
||||
SetBufferCommitInfoNeedsSave(buf);
|
||||
}
|
||||
LockBuffer(hbuffer, BUFFER_LOCK_UNLOCK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue