Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fd3ad7d7
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,发现更多精彩内容 >>
提交
fd3ad7d7
编写于
9月 12, 1997
作者:
V
Vadim B. Mikheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow to call utility funcs without SPI_connect.
上级
7f97e05b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
47 deletion
+5
-47
src/backend/executor/spi.c
src/backend/executor/spi.c
+5
-47
未找到文件。
src/backend/executor/spi.c
浏览文件 @
fd3ad7d7
...
...
@@ -48,7 +48,7 @@ static void _SPI_fetch(FetchStmt * stmt);
#endif
static
int
_SPI_execute_plan
(
_SPI_plan
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
);
Datum
*
Values
,
char
*
Nulls
,
int
tcount
);
#define _SPI_CPLAN_CURCXT 0
#define _SPI_CPLAN_PROCXT 1
...
...
@@ -199,7 +199,7 @@ SPI_exec(char *src, int tcount)
}
int
SPI_execp
(
void
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
)
SPI_execp
(
void
*
plan
,
Datum
*
Values
,
char
*
Nulls
,
int
tcount
)
{
int
res
;
...
...
@@ -282,10 +282,7 @@ int
SPI_fnumber
(
TupleDesc
tupdesc
,
char
*
fname
)
{
int
res
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
return
(
SPI_ERROR_UNCONNECTED
);
for
(
res
=
0
;
res
<
tupdesc
->
natts
;
res
++
)
{
if
(
strcasecmp
(
tupdesc
->
attrs
[
res
]
->
attname
.
data
,
fname
)
==
0
)
...
...
@@ -300,12 +297,6 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -313,7 +304,6 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
}
return
(
nameout
(
&
(
tupdesc
->
attrs
[
fnumber
-
1
]
->
attname
)));
}
char
*
...
...
@@ -324,12 +314,6 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
Oid
foutoid
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tuple
->
t_natts
<
fnumber
||
fnumber
<=
0
)
return
(
NULL
);
...
...
@@ -353,12 +337,6 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
*
isnull
=
true
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tuple
->
t_natts
<
fnumber
||
fnumber
<=
0
)
return
(
NULL
);
...
...
@@ -373,12 +351,6 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
HeapTuple
typeTuple
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -403,12 +375,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
InvalidOid
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -421,14 +387,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
char
*
SPI_getrelname
(
Relation
rel
)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
return
(
pstrdup
(
rel
->
rd_rel
->
relname
.
data
));
}
...
...
@@ -581,7 +539,7 @@ _SPI_execute(char *src, int tcount, _SPI_plan * plan)
}
static
int
_SPI_execute_plan
(
_SPI_plan
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
)
_SPI_execute_plan
(
_SPI_plan
*
plan
,
Datum
*
Values
,
char
*
Nulls
,
int
tcount
)
{
QueryTreeList
*
queryTree_list
=
plan
->
qtlist
;
List
*
planTree_list
=
plan
->
ptlist
;
...
...
@@ -634,7 +592,7 @@ _SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
paramLI
->
kind
=
PARAM_NUM
;
paramLI
->
id
=
k
+
1
;
paramLI
->
isnull
=
(
Nulls
!=
NULL
&&
Nulls
[
k
]
!=
'n'
);
paramLI
->
value
=
(
Datum
)
Values
[
k
];
paramLI
->
value
=
Values
[
k
];
}
paramLI
->
kind
=
PARAM_INVALID
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录