Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3a1ab7

Browse files
committed
READ COMMITTED isolevel is implemented and is default now.
1 parent3e2f87f commite3a1ab7

File tree

12 files changed

+499
-128
lines changed

12 files changed

+499
-128
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.39 1998/12/15 12:45:13 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.40 1999/01/29 09:22:51 vadim Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -1373,6 +1373,7 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer)
13731373
if (result!=HeapTupleMayBeUpdated)
13741374
{
13751375
Assert(result==HeapTupleSelfUpdated||result==HeapTupleUpdated);
1376+
tuple->t_self=tuple->t_data->t_ctid;
13761377
LockBuffer(*buffer,BUFFER_LOCK_UNLOCK);
13771378
returnresult;
13781379
}

‎src/backend/access/nbtree/nbtinsert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.32 1998/12/15 12:45:20 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.33 1999/01/29 09:22:52 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -134,6 +134,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
134134
* If this tuple is being updated by other transaction
135135
* then we have to wait for its commit/abort.
136136
*/
137+
ReleaseBuffer(buffer);
137138
if (TransactionIdIsValid(xwait))
138139
{
139140
if (nbuf!=InvalidBuffer)

‎src/backend/access/transam/xact.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.28 1998/12/18 09:10:18 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.29 1999/01/29 09:22:53 vadim Exp $
1111
*
1212
* NOTES
1313
*Transaction aborts can now occur two ways:
@@ -194,7 +194,7 @@ TransactionStateData CurrentTransactionStateData = {
194194
TransactionStateCurrentTransactionState=
195195
&CurrentTransactionStateData;
196196

197-
intDefaultXactIsoLevel=XACT_SERIALIZABLE;
197+
intDefaultXactIsoLevel=XACT_READ_COMMITTED;
198198
intXactIsoLevel;
199199

200200
/* ----------------

‎src/backend/commands/trigger.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include"utils/inval.h"
2929
#include"utils/builtins.h"
3030
#include"utils/syscache.h"
31+
#include"executor/executor.h"
3132

3233
#ifndefNO_SECURITY
3334
#include"miscadmin.h"
@@ -790,6 +791,8 @@ ExecARUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
790791
return;
791792
}
792793

794+
externTupleTableSlot*EvalPlanQual(EState*estate,Indexrti,ItemPointertid);
795+
793796
staticHeapTuple
794797
GetTupleForTrigger(EState*estate,ItemPointertid,boolbefore)
795798
{
@@ -806,6 +809,7 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before)
806809
*mark tuple for update
807810
*/
808811
tuple.t_self=*tid;
812+
ltrmark:;
809813
test=heap_mark4update(relation,&tuple,&buffer);
810814
switch (test)
811815
{
@@ -820,8 +824,23 @@ GetTupleForTrigger(EState *estate, ItemPointer tid, bool before)
820824
ReleaseBuffer(buffer);
821825
if (XactIsoLevel==XACT_SERIALIZABLE)
822826
elog(ERROR,"Can't serialize access due to concurrent update");
823-
else
824-
elog(ERROR,"Isolation level %u is not supported",XactIsoLevel);
827+
elseif (!(ItemPointerEquals(&(tuple.t_self),tid)))
828+
{
829+
TupleTableSlot*slot=EvalPlanQual(estate,
830+
estate->es_result_relation_info->ri_RangeTableIndex,
831+
&(tuple.t_self));
832+
833+
if (!(TupIsNull(slot)))
834+
{
835+
*tid=tuple.t_self;
836+
gotoltrmark;
837+
}
838+
}
839+
/*
840+
* if tuple was deleted or PlanQual failed
841+
* for updated tuple - we have not process
842+
* this tuple!
843+
*/
825844
return(NULL);
826845

827846
default:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp