1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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.
This commit is contained in:
Tom Lane
2004-10-15 22:40:29 +00:00
parent db9e2fd0a9
commit 9ffc8ed58b
13 changed files with 241 additions and 176 deletions

View File

@ -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);