Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
62c42a05
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62c42a05
编写于
12月 10, 1999
作者:
J
Jan Wieck
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added global variable to have RI triggers override
time qualification of HeapTupleSatisfiesSnapshot() Jan
上级
d31ff14e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
3 deletion
+30
-3
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+8
-0
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ri_triggers.c
+10
-1
src/backend/utils/time/tqual.c
src/backend/utils/time/tqual.c
+9
-1
src/include/utils/tqual.h
src/include/utils/tqual.h
+3
-1
未找到文件。
src/backend/commands/trigger.c
浏览文件 @
62c42a05
...
...
@@ -24,6 +24,7 @@
#include "utils/builtins.h"
#include "utils/inval.h"
#include "utils/syscache.h"
#include "utils/tqual.h"
DLLIMPORT
TriggerData
*
CurrentTriggerData
=
NULL
;
...
...
@@ -1151,6 +1152,13 @@ deferredTriggerExecute(DeferredTriggerEvent event, int itemno)
if
(
rettuple
!=
NULL
&&
rettuple
!=
&
oldtuple
&&
rettuple
!=
&
newtuple
)
pfree
(
rettuple
);
/* ----------
* Might have been a referential integrity constraint trigger.
* Reset the snapshot overriding flag.
* ----------
*/
ReferentialIntegritySnapshotOverride
=
false
;
/* ----------
* Release buffers and close the relation
* ----------
...
...
src/backend/utils/adt/ri_triggers.c
浏览文件 @
62c42a05
...
...
@@ -6,7 +6,7 @@
*
* 1999 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.
9 1999/12/08 20:41:22
wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.
10 1999/12/10 12:34:13
wieck Exp $
*
* ----------
*/
...
...
@@ -163,6 +163,7 @@ RI_FKey_check (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -489,6 +490,7 @@ RI_FKey_cascade_del (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -686,6 +688,7 @@ RI_FKey_cascade_upd (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -911,6 +914,7 @@ RI_FKey_restrict_del (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -1118,6 +1122,7 @@ RI_FKey_restrict_upd (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -1333,6 +1338,7 @@ RI_FKey_setnull_del (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -1540,6 +1546,7 @@ RI_FKey_setnull_upd (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -1758,6 +1765,7 @@ RI_FKey_setdefault_del (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
@@ -2005,6 +2013,7 @@ RI_FKey_setdefault_upd (FmgrInfo *proinfo)
trigdata
=
CurrentTriggerData
;
CurrentTriggerData
=
NULL
;
ReferentialIntegritySnapshotOverride
=
true
;
/* ----------
* Check that this is a valid trigger call on the right time and event.
...
...
src/backend/utils/time/tqual.c
浏览文件 @
62c42a05
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.3
2 1999/10/06 21:58:11 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.3
3 1999/12/10 12:34:14 wieck
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,6 +24,8 @@ Snapshot SnapshotDirty = &SnapshotDirtyData;
Snapshot
QuerySnapshot
=
NULL
;
Snapshot
SerializableSnapshot
=
NULL
;
bool
ReferentialIntegritySnapshotOverride
=
false
;
/*
* XXX Transaction system override hacks start here
*/
...
...
@@ -493,6 +495,9 @@ HeapTupleSatisfiesSnapshot(HeapTupleHeader tuple, Snapshot snapshot)
if
(
AMI_OVERRIDE
)
return
true
;
if
(
ReferentialIntegritySnapshotOverride
)
return
HeapTupleSatisfiesNow
(
tuple
);
if
(
!
(
tuple
->
t_infomask
&
HEAP_XMIN_COMMITTED
))
{
if
(
tuple
->
t_infomask
&
HEAP_XMIN_INVALID
)
...
...
@@ -606,6 +611,9 @@ void
SetQuerySnapshot
(
void
)
{
/* Initialize snapshot overriding to false */
ReferentialIntegritySnapshotOverride
=
false
;
/* 1st call in xaction */
if
(
SerializableSnapshot
==
NULL
)
{
...
...
src/include/utils/tqual.h
浏览文件 @
62c42a05
...
...
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: tqual.h,v 1.2
5 1999/09/29 16:06:28
wieck Exp $
* $Id: tqual.h,v 1.2
6 1999/12/10 12:34:15
wieck Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -36,6 +36,8 @@ extern Snapshot SnapshotDirty;
extern
Snapshot
QuerySnapshot
;
extern
Snapshot
SerializableSnapshot
;
extern
bool
ReferentialIntegritySnapshotOverride
;
#define IsSnapshotNow(snapshot) ((Snapshot) snapshot == SnapshotNow)
#define IsSnapshotSelf(snapshot) ((Snapshot) snapshot == SnapshotSelf)
#define IsSnapshotAny(snapshot) ((Snapshot) snapshot == SnapshotAny)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录