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

READ COMMITTED isolevel is implemented and is default now.

This commit is contained in:
Vadim B. Mikheev
1999-01-29 09:23:17 +00:00
parent 3e2f87f3f3
commit e3a1ab764e
12 changed files with 499 additions and 128 deletions

View File

@ -28,6 +28,7 @@
#include "utils/inval.h"
#include "utils/builtins.h"
#include "utils/syscache.h"
#include "executor/executor.h"
#ifndef NO_SECURITY
#include "miscadmin.h"
@ -790,6 +791,8 @@ ExecARUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
return;
}
extern TupleTableSlot *EvalPlanQual(EState *estate, Index rti, ItemPointer tid);
static HeapTuple
GetTupleForTrigger(EState *estate, ItemPointer tid, bool before)
{
@ -806,6 +809,7 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before)
* mark tuple for update
*/
tuple.t_self = *tid;
ltrmark:;
test = heap_mark4update(relation, &tuple, &buffer);
switch (test)
{
@ -820,8 +824,23 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before)
ReleaseBuffer(buffer);
if (XactIsoLevel == XACT_SERIALIZABLE)
elog(ERROR, "Can't serialize access due to concurrent update");
else
elog(ERROR, "Isolation level %u is not supported", XactIsoLevel);
else if (!(ItemPointerEquals(&(tuple.t_self), tid)))
{
TupleTableSlot *slot = EvalPlanQual(estate,
estate->es_result_relation_info->ri_RangeTableIndex,
&(tuple.t_self));
if (!(TupIsNull(slot)))
{
*tid = tuple.t_self;
goto ltrmark;
}
}
/*
* if tuple was deleted or PlanQual failed
* for updated tuple - we have not process
* this tuple!
*/
return(NULL);
default: