mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Get rid of ReferentialIntegritySnapshotOverride by extending Executor API
to allow es_snapshot to be set to SnapshotNow rather than a query snapshot. This solves a bug reported by Wade Klaver, wherein triggers fired as a result of RI cascade updates could misbehave.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.68 2003/09/22 00:47:23 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.69 2003/09/25 18:58:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -39,8 +39,6 @@ Snapshot SerializableSnapshot = NULL;
|
||||
TransactionId RecentXmin = InvalidTransactionId;
|
||||
TransactionId RecentGlobalXmin = InvalidTransactionId;
|
||||
|
||||
bool ReferentialIntegritySnapshotOverride = false;
|
||||
|
||||
|
||||
/*
|
||||
* HeapTupleSatisfiesItself
|
||||
@@ -665,10 +663,6 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple)
|
||||
bool
|
||||
HeapTupleSatisfiesSnapshot(HeapTupleHeader tuple, Snapshot snapshot)
|
||||
{
|
||||
/* XXX this is horribly ugly: */
|
||||
if (ReferentialIntegritySnapshotOverride)
|
||||
return HeapTupleSatisfiesNow(tuple);
|
||||
|
||||
if (!(tuple->t_infomask & HEAP_XMIN_COMMITTED))
|
||||
{
|
||||
if (tuple->t_infomask & HEAP_XMIN_INVALID)
|
||||
@@ -978,9 +972,6 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin)
|
||||
void
|
||||
SetQuerySnapshot(void)
|
||||
{
|
||||
/* Initialize snapshot overriding to false */
|
||||
ReferentialIntegritySnapshotOverride = false;
|
||||
|
||||
/* 1st call in xaction? */
|
||||
if (SerializableSnapshot == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user