projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81bd514
)
Fix longstanding bug found by Atsushi Ogawa: _bt_check_unique would mark
author
Tom Lane
<tgl@sss.pgh.pa.us>
Wed, 12 Oct 2005 17:18:31 +0000
(17:18 +0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Wed, 12 Oct 2005 17:18:31 +0000
(17:18 +0000)
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.
src/backend/access/nbtree/nbtinsert.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/access/nbtree/nbtinsert.c
b/src/backend/access/nbtree/nbtinsert.c
index f85200328eb552b04fc0807e51a81a96ecf360d3..184be5765f2c4fadc7b6850cd3bdf986006431b9 100644
(file)
--- a/
src/backend/access/nbtree/nbtinsert.c
+++ b/
src/backend/access/nbtree/nbtinsert.c
@@
-270,7
+270,10
@@
_bt_check_unique(Relation rel, BTItem btitem, Relation heapRel,
HEAPTUPLE_DEAD)
{
curitemid->lp_flags |= LP_DELETE;
- SetBufferCommitInfoNeedsSave(buf);
+ if (nbuf != InvalidBuffer)
+ SetBufferCommitInfoNeedsSave(nbuf);
+ else
+ SetBufferCommitInfoNeedsSave(buf);
}
if (sv_infomask != htup.t_data->t_infomask)
SetBufferCommitInfoNeedsSave(hbuffer);