Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
1adb6a9d
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,发现更多精彩内容 >>
提交
1adb6a9d
编写于
12月 20, 1998
作者:
M
Marc G. Fournier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
finished cleaning up outnodes.c ...
上级
3cd3be92
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
117 deletion
+61
-117
src/backend/nodes/outfuncs.c
src/backend/nodes/outfuncs.c
+61
-117
未找到文件。
src/backend/nodes/outfuncs.c
浏览文件 @
1adb6a9d
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: outfuncs.c,v 1.5
7 1998/12/18 14:45:08 wieck
Exp $
* $Id: outfuncs.c,v 1.5
8 1998/12/20 07:13:36 scrappy
Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
...
...
@@ -71,10 +71,11 @@ _outCreateStmt(StringInfo str, CreateStmt *node)
{
appendStringInfo
(
str
,
" CREATE :relname %s :columns "
,
stringStringInfo
(
node
->
relname
));
_outNode
(
str
,
node
->
tableElts
);
appendStringInfo
(
str
,
" :inhRelnames "
);
_outNode
(
str
,
node
->
inhRelnames
);
appendStringInfo
(
str
,
" :constraints "
);
_outNode
(
str
,
node
->
constraints
);
}
...
...
@@ -87,12 +88,14 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
stringStringInfo
(
node
->
idxname
),
stringStringInfo
(
node
->
relname
),
stringStringInfo
(
node
->
accessMethod
));
_outNode
(
str
,
node
->
indexParams
);
appendStringInfo
(
str
,
" :withClause "
);
_outNode
(
str
,
node
->
withClause
);
appendStringInfo
(
str
,
" :whereClause "
);
_outNode
(
str
,
node
->
whereClause
);
appendStringInfo
(
str
,
" :rangetable "
);
_outNode
(
str
,
node
->
rangetable
);
...
...
@@ -112,8 +115,7 @@ _outSelectStmt(StringInfo str, SelectStmt *node)
static
void
_outFuncCall
(
StringInfo
str
,
FuncCall
*
node
)
{
appendStringInfo
(
str
,
"FUNCTION %s :args "
,
stringStringInfo
(
node
->
funcname
));
appendStringInfo
(
str
,
"FUNCTION %s :args "
,
stringStringInfo
(
node
->
funcname
));
_outNode
(
str
,
node
->
args
);
}
...
...
@@ -153,8 +155,7 @@ _outIndexElem(StringInfo str, IndexElem *node)
stringStringInfo
(
node
->
name
));
_outNode
(
str
,
node
->
args
);
appendStringInfo
(
str
,
" :class %s :typename "
,
stringStringInfo
(
node
->
class
));
appendStringInfo
(
str
,
" :class %s :typename "
,
stringStringInfo
(
node
->
class
));
_outNode
(
str
,
node
->
typename
);
}
...
...
@@ -727,8 +728,7 @@ _outArray(StringInfo str, Array *node)
node
->
arrayelemlength
,
node
->
arrayelembyval
?
't'
:
'f'
);
appendStringInfo
(
str
,
" :arrayndim %d "
,
node
->
arrayndim
);
appendStringInfo
(
str
,
" :arraylow "
);
appendStringInfo
(
str
,
" :arrayndim %d :arraylow "
,
node
->
arrayndim
);
for
(
i
=
0
;
i
<
node
->
arrayndim
;
i
++
)
{
appendStringInfo
(
str
,
" %d "
,
node
->
arraylow
.
indx
[
i
]);
...
...
@@ -1055,9 +1055,7 @@ _outOrderKey(StringInfo str, OrderKey *node)
static
void
_outJoinKey
(
StringInfo
str
,
JoinKey
*
node
)
{
appendStringInfo
(
str
,
" JOINKEY "
);
appendStringInfo
(
str
,
" :outer "
);
appendStringInfo
(
str
,
" JOINKEY :outer "
);
_outNode
(
str
,
node
->
outer
);
appendStringInfo
(
str
,
" :inner "
);
...
...
@@ -1071,21 +1069,16 @@ _outJoinKey(StringInfo str, JoinKey *node)
static
void
_outMergeOrder
(
StringInfo
str
,
MergeOrder
*
node
)
{
char
buf
[
500
];
appendStringInfo
(
str
,
" MERGEORDER "
);
sprintf
(
buf
,
" :join_operator %d "
,
node
->
join_operator
);
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :left_operator %d "
,
node
->
left_operator
);
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :right_operator %d "
,
node
->
right_operator
);
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :left_type %d "
,
node
->
left_type
);
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :right_type %d "
,
node
->
right_type
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" MERGEORDER :join_operator %d :left_operator %d :right_operator %d "
,
node
->
join_operator
,
node
->
left_operator
,
node
->
right_operator
);
appendStringInfo
(
str
,
" :left_type %d :right_type %d "
,
node
->
left_type
,
node
->
right_type
);
}
/*
...
...
@@ -1094,26 +1087,19 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
static
void
_outClauseInfo
(
StringInfo
str
,
ClauseInfo
*
node
)
{
char
buf
[
500
];
appendStringInfo
(
str
,
" CINFO "
);
appendStringInfo
(
str
,
" :clause "
);
appendStringInfo
(
str
,
" CINFO :clause "
);
_outNode
(
str
,
node
->
clause
);
sprintf
(
buf
,
" :selectivity %f "
,
node
->
selectivity
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" :notclause "
);
appendStringInfo
(
str
,
node
->
notclause
?
"true"
:
"false"
);
appendStringInfo
(
str
,
" :indexids "
);
appendStringInfo
(
str
,
" :selectivity %f :notclause %s :indexids "
,
node
->
selectivity
,
node
->
notclause
?
"true"
:
"false"
);
_outNode
(
str
,
node
->
indexids
);
appendStringInfo
(
str
,
" :mergejoinorder "
);
_outNode
(
str
,
node
->
mergejoinorder
);
sprintf
(
buf
,
" :hashjoinoperator %u "
,
node
->
hashjoinoperator
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" :hashjoinoperator %u "
,
node
->
hashjoinoperator
);
}
...
...
@@ -1123,15 +1109,11 @@ _outClauseInfo(StringInfo str, ClauseInfo * node)
static
void
_outJoinMethod
(
StringInfo
str
,
JoinMethod
*
node
)
{
appendStringInfo
(
str
,
" JOINMETHOD "
);
appendStringInfo
(
str
,
" :jmkeys "
);
appendStringInfo
(
str
,
" JOINMETHOD :jmkeys "
);
_outNode
(
str
,
node
->
jmkeys
);
appendStringInfo
(
str
,
" :clauses "
);
_outNode
(
str
,
node
->
clauses
);
}
/*
...
...
@@ -1140,20 +1122,11 @@ _outJoinMethod(StringInfo str, JoinMethod *node)
static
void
_outHInfo
(
StringInfo
str
,
HInfo
*
node
)
{
char
buf
[
500
];
appendStringInfo
(
str
,
" HASHINFO "
);
appendStringInfo
(
str
,
" :hashop "
);
sprintf
(
buf
,
" %u "
,
node
->
hashop
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" :jmkeys "
);
appendStringInfo
(
str
,
" HASHINFO :hashop %u :jmkeys "
,
node
->
hashop
);
_outNode
(
str
,
node
->
jmethod
.
jmkeys
);
appendStringInfo
(
str
,
" :clauses "
);
_outNode
(
str
,
node
->
jmethod
.
clauses
);
}
/*
...
...
@@ -1162,19 +1135,15 @@ _outHInfo(StringInfo str, HInfo *node)
static
void
_outJoinInfo
(
StringInfo
str
,
JoinInfo
*
node
)
{
appendStringInfo
(
str
,
" JINFO "
);
appendStringInfo
(
str
,
" :otherrels "
);
appendStringInfo
(
str
,
" JINFO :otherrels "
);
_outIntList
(
str
,
node
->
otherrels
);
appendStringInfo
(
str
,
" :jinfoclauseinfo "
);
_outNode
(
str
,
node
->
jinfoclauseinfo
);
appendStringInfo
(
str
,
" :mergejoinable "
);
appendStringInfo
(
str
,
node
->
mergejoinable
?
"true"
:
"false"
);
appendStringInfo
(
str
,
" :hashjoinable "
);
appendStringInfo
(
str
,
node
->
hashjoinable
?
"true"
:
"false"
);
appendStringInfo
(
str
,
" :mergejoinable %s :hashjoinable %s "
,
node
->
mergejoinable
?
"true"
:
"false"
,
node
->
hashjoinable
?
"true"
:
"false"
);
}
/*
...
...
@@ -1183,12 +1152,11 @@ _outJoinInfo(StringInfo str, JoinInfo * node)
static
void
_outDatum
(
StringInfo
str
,
Datum
value
,
Oid
type
)
{
char
buf
[
500
]
;
char
*
s
;
Size
length
,
typeLength
;
typeLength
;
bool
byValue
;
int
i
;
char
*
s
;
/*
* find some information about the type and the "real" length of the
...
...
@@ -1201,42 +1169,34 @@ _outDatum(StringInfo str, Datum value, Oid type)
if
(
byValue
)
{
s
=
(
char
*
)
(
&
value
);
sprintf
(
buf
,
" %d [ "
,
length
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" %d [ "
,
length
);
for
(
i
=
0
;
i
<
sizeof
(
Datum
);
i
++
)
{
sprintf
(
buf
,
" %d "
,
(
int
)
(
s
[
i
]));
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" %d "
,
(
int
)
(
s
[
i
]));
}
sprintf
(
buf
,
"] "
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
"] "
);
}
else
{
/* !byValue */
s
=
(
char
*
)
DatumGetPointer
(
value
);
if
(
!
PointerIsValid
(
s
))
{
sprintf
(
buf
,
" 0 [ ] "
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" 0 [ ] "
);
}
else
{
/*
* length is unsigned - very bad to do < comparison to -1
* without casting it to int first!! -mer 8 Jan 1991
*/
if
(((
int
)
length
)
<=
-
1
)
length
=
VARSIZE
(
s
);
sprintf
(
buf
,
" %d [ "
,
length
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" %d [ "
,
length
);
for
(
i
=
0
;
i
<
length
;
i
++
)
{
sprintf
(
buf
,
" %d "
,
(
int
)
(
s
[
i
]));
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" %d "
,
(
int
)
(
s
[
i
]));
}
sprintf
(
buf
,
"] "
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
"] "
);
}
}
}
...
...
@@ -1244,42 +1204,26 @@ _outDatum(StringInfo str, Datum value, Oid type)
static
void
_outIter
(
StringInfo
str
,
Iter
*
node
)
{
appendStringInfo
(
str
,
" ITER "
);
appendStringInfo
(
str
,
" :iterexpr "
);
appendStringInfo
(
str
,
" ITER :iterexpr "
);
_outNode
(
str
,
node
->
iterexpr
);
}
static
void
_outStream
(
StringInfo
str
,
Stream
*
node
)
{
char
buf
[
500
];
appendStringInfo
(
str
,
" STREAM "
);
sprintf
(
buf
,
" :pathptr @ 0x%x "
,
(
int
)
(
node
->
pathptr
));
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :cinfo @ 0x%x "
,
(
int
)
(
node
->
cinfo
));
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :clausetype %d "
,
(
int
)
(
node
->
clausetype
));
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :upstream @ 0x%x "
,
(
int
)
(
node
->
upstream
));
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :downstream @ 0x%x "
,
(
int
)
(
node
->
downstream
));
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :groupup %d "
,
node
->
groupup
);
appendStringInfo
(
str
,
buf
);
sprintf
(
buf
,
" :groupcost %f "
,
node
->
groupcost
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" STREAM :pathptr @ 0x%x :cinfo @ 0x%x :clausetype %d :upstream @ 0x%x "
,
(
int
)
node
->
pathptr
,
(
int
)
node
->
cinfo
,
(
int
)
node
->
clausetype
,
(
int
)
node
->
upstream
);
sprintf
(
buf
,
" :groupsel %f "
,
node
->
groupsel
);
appendStringInfo
(
str
,
buf
);
appendStringInfo
(
str
,
" :downstream @ 0x%x :groupup %d :groupcost %f :groupsel %f "
,
(
int
)
node
->
downstream
,
node
->
groupup
,
node
->
groupcost
,
node
->
groupsel
);
}
static
void
...
...
@@ -1322,8 +1266,7 @@ _outValue(StringInfo str, Value *value)
switch
(
value
->
type
)
{
case
T_String
:
appendStringInfo
(
str
,
"
\"
%s
\"
"
,
stringStringInfo
(
value
->
val
.
str
));
appendStringInfo
(
str
,
"
\"
%s
\"
"
,
stringStringInfo
(
value
->
val
.
str
));
break
;
case
T_Integer
:
appendStringInfo
(
str
,
" %ld "
,
value
->
val
.
ival
);
...
...
@@ -1355,8 +1298,7 @@ _outAConst(StringInfo str, A_Const *node)
static
void
_outConstraint
(
StringInfo
str
,
Constraint
*
node
)
{
appendStringInfo
(
str
,
" %s :type"
,
stringStringInfo
(
node
->
name
));
appendStringInfo
(
str
,
" %s :type"
,
stringStringInfo
(
node
->
name
));
switch
(
node
->
contype
)
{
...
...
@@ -1366,13 +1308,11 @@ _outConstraint(StringInfo str, Constraint *node)
break
;
case
CONSTR_CHECK
:
appendStringInfo
(
str
,
" CHECK %s"
,
stringStringInfo
(
node
->
def
));
appendStringInfo
(
str
,
" CHECK %s"
,
stringStringInfo
(
node
->
def
));
break
;
case
CONSTR_DEFAULT
:
appendStringInfo
(
str
,
" DEFAULT %s"
,
stringStringInfo
(
node
->
def
));
appendStringInfo
(
str
,
" DEFAULT %s"
,
stringStringInfo
(
node
->
def
));
break
;
case
CONSTR_NOTNULL
:
...
...
@@ -1396,8 +1336,10 @@ _outCaseExpr(StringInfo str, CaseExpr *node)
{
appendStringInfo
(
str
,
"CASE "
);
_outNode
(
str
,
node
->
args
);
appendStringInfo
(
str
,
" :default "
);
_outNode
(
str
,
node
->
defresult
);
return
;
}
...
...
@@ -1406,8 +1348,10 @@ _outCaseWhen(StringInfo str, CaseWhen *node)
{
appendStringInfo
(
str
,
" WHEN "
);
_outNode
(
str
,
node
->
expr
);
appendStringInfo
(
str
,
" :then "
);
_outNode
(
str
,
node
->
result
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录