aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ri_triggers.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-10-15 22:40:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-10-15 22:40:29 +0000
commit9ffc8ed58b55cb3925bb95cc184583fcb9772013 (patch)
tree9039f51525070c611a86f03a2e85a13b24005ac3 /src/backend/utils/adt/ri_triggers.c
parentdb9e2fd0a9144707055ed382f184f5a9c11aafff (diff)
downloadpostgresql-9ffc8ed58b55cb3925bb95cc184583fcb9772013.tar.gz
postgresql-9ffc8ed58b55cb3925bb95cc184583fcb9772013.zip
Repair possible failure to update hint bits back to disk, per
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php. This fix is intended to be permanent: it moves the responsibility for calling SetBufferCommitInfoNeedsSave() into the tqual.c routines, eliminating the requirement for callers to test whether t_infomask changed. Also, tighten validity checking on buffer IDs in bufmgr.c --- several routines were paranoid about out-of-range shared buffer numbers but not about out-of-range local ones, which seems a tad pointless.
Diffstat (limited to 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r--src/backend/utils/adt/ri_triggers.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 20ad56c31f1..b195e243393 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -17,7 +17,7 @@
*
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.73 2004/09/13 20:07:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.74 2004/10/15 22:40:11 tgl Exp $
*
* ----------
*/
@@ -224,10 +224,15 @@ RI_FKey_check(PG_FUNCTION_ARGS)
* We should not even consider checking the row if it is no longer
* valid since it was either deleted (doesn't matter) or updated (in
* which case it'll be checked with its final values).
+ *
+ * We do not know what buffer the new_row is in, but it doesn't matter
+ * since it's not possible for a hint-bit update to occur here (the
+ * new_row could only contain our own XID, and we haven't yet committed
+ * or aborted...)
*/
if (new_row)
{
- if (!HeapTupleSatisfiesItself(new_row->t_data))
+ if (!HeapTupleSatisfiesItself(new_row->t_data, InvalidBuffer))
{
heap_close(pk_rel, RowShareLock);
return PointerGetDatum(NULL);