Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
987026c9
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,发现更多精彩内容 >>
提交
987026c9
编写于
10月 31, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rule dumper failed to affix '*' to inheritable RTEs.
上级
557ca54d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
20 deletion
+24
-20
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/ruleutils.c
+24
-20
未找到文件。
src/backend/utils/adt/ruleutils.c
浏览文件 @
987026c9
...
...
@@ -3,7 +3,7 @@
* out of it's tuple
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.2
8 1999/10/04 04:37:23
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.2
9 1999/10/31 18:57:42
tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -40,14 +40,15 @@
#include "postgres.h"
#include "executor/spi.h"
#include "lib/stringinfo.h"
#include "optimizer/clauses.h"
#include "optimizer/tlist.h"
#include "catalog/pg_index.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_shadow.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
#include "lib/stringinfo.h"
#include "optimizer/clauses.h"
#include "optimizer/tlist.h"
#include "parser/parsetree.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
...
...
@@ -112,6 +113,8 @@ static bool check_if_rte_used(Node *node, Index rt_index, int levelsup);
static
bool
check_if_rte_used_walker
(
Node
*
node
,
check_if_rte_used_context
*
context
);
#define inherit_marker(rte) ((rte)->inh ? "*" : "")
/* ----------
* get_ruledef - Do it all and return a text
...
...
@@ -907,7 +910,7 @@ get_select_query_def(Query *query, deparse_context *context)
/* ----------
* Now check if any of the used rangetable entries is different
* from *NEW* and *CURRENT*. If so we must
omit
the FROM clause
* from *NEW* and *CURRENT*. If so we must
provide
the FROM clause
* later.
* ----------
*/
...
...
@@ -965,13 +968,11 @@ get_select_query_def(Query *query, deparse_context *context)
quote_identifier
(
tle
->
resdom
->
resname
));
}
/* If we need other tables tha
t
*NEW* or *CURRENT* add the FROM clause */
/* If we need other tables tha
n
*NEW* or *CURRENT* add the FROM clause */
if
(
!
rt_constonly
&&
rt_numused
>
0
)
{
appendStringInfo
(
buf
,
" FROM"
);
sep
=
" FROM "
;
i
=
0
;
sep
=
" "
;
foreach
(
l
,
query
->
rtable
)
{
if
(
rt_used
[
i
++
])
...
...
@@ -986,8 +987,9 @@ get_select_query_def(Query *query, deparse_context *context)
appendStringInfo
(
buf
,
sep
);
sep
=
", "
;
appendStringInfo
(
buf
,
"%s"
,
quote_identifier
(
rte
->
relname
));
appendStringInfo
(
buf
,
"%s%s"
,
quote_identifier
(
rte
->
relname
),
inherit_marker
(
rte
));
if
(
strcmp
(
rte
->
relname
,
rte
->
refname
)
!=
0
)
appendStringInfo
(
buf
,
" %s"
,
quote_identifier
(
rte
->
refname
));
...
...
@@ -1081,7 +1083,7 @@ get_insert_query_def(Query *query, deparse_context *context)
* Start the query with INSERT INTO relname
* ----------
*/
rte
=
(
RangeTblEntry
*
)
nth
(
query
->
resultRelation
-
1
,
query
->
rtable
);
rte
=
rt_fetch
(
query
->
resultRelation
,
query
->
rtable
);
appendStringInfo
(
buf
,
"INSERT INTO %s"
,
quote_identifier
(
rte
->
relname
));
...
...
@@ -1134,9 +1136,10 @@ get_update_query_def(Query *query, deparse_context *context)
* Start the query with UPDATE relname SET
* ----------
*/
rte
=
(
RangeTblEntry
*
)
nth
(
query
->
resultRelation
-
1
,
query
->
rtable
);
appendStringInfo
(
buf
,
"UPDATE %s SET "
,
quote_identifier
(
rte
->
relname
));
rte
=
rt_fetch
(
query
->
resultRelation
,
query
->
rtable
);
appendStringInfo
(
buf
,
"UPDATE %s%s SET "
,
quote_identifier
(
rte
->
relname
),
inherit_marker
(
rte
));
/* Add the comma separated list of 'attname = value' */
sep
=
""
;
...
...
@@ -1174,9 +1177,10 @@ get_delete_query_def(Query *query, deparse_context *context)
* Start the query with DELETE FROM relname
* ----------
*/
rte
=
(
RangeTblEntry
*
)
nth
(
query
->
resultRelation
-
1
,
query
->
rtable
);
appendStringInfo
(
buf
,
"DELETE FROM %s"
,
quote_identifier
(
rte
->
relname
));
rte
=
rt_fetch
(
query
->
resultRelation
,
query
->
rtable
);
appendStringInfo
(
buf
,
"DELETE FROM %s%s"
,
quote_identifier
(
rte
->
relname
),
inherit_marker
(
rte
));
/* Add a WHERE clause if given */
if
(
query
->
qual
!=
NULL
)
...
...
@@ -1198,7 +1202,7 @@ get_rte_for_var(Var *var, deparse_context *context)
while
(
sup
--
>
0
)
rtlist
=
lnext
(
rtlist
);
return
(
RangeTblEntry
*
)
nth
(
var
->
varno
-
1
,
(
List
*
)
lfirst
(
rtlist
));
return
rt_fetch
(
var
->
varno
,
(
List
*
)
lfirst
(
rtlist
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录