~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/backend/utils/time/tqual.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-06-14 09:53:29 UTC
  • mto: (6.1.1 sid) (10.1.1 oneiric-proposed) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20110614095329-71gfhjywyp2c27au
Tags: upstream-9.1~beta2
ImportĀ upstreamĀ versionĀ 9.1~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1217
1217
        }
1218
1218
 
1219
1219
        /*
1220
 
         * Deleter committed, but check special cases.
 
1220
         * Deleter committed, but perhaps it was recent enough that some open
 
1221
         * transactions could still see the tuple.
1221
1222
         */
1222
 
 
1223
 
        if (TransactionIdEquals(HeapTupleHeaderGetXmin(tuple),
1224
 
                                                        HeapTupleHeaderGetXmax(tuple)))
1225
 
        {
1226
 
                /*
1227
 
                 * Inserter also deleted it, so it was never visible to anyone else.
1228
 
                 * However, we can only remove it early if it's not an updated tuple;
1229
 
                 * else its parent tuple is linking to it via t_ctid, and this tuple
1230
 
                 * mustn't go away before the parent does.
1231
 
                 */
1232
 
                if (!(tuple->t_infomask & HEAP_UPDATED))
1233
 
                        return HEAPTUPLE_DEAD;
1234
 
        }
1235
 
 
1236
1223
        if (!TransactionIdPrecedes(HeapTupleHeaderGetXmax(tuple), OldestXmin))
1237
 
        {
1238
 
                /* deleting xact is too recent, tuple could still be visible */
1239
1224
                return HEAPTUPLE_RECENTLY_DEAD;
1240
 
        }
1241
1225
 
1242
1226
        /* Otherwise, it's dead and removable */
1243
1227
        return HEAPTUPLE_DEAD;