Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b0283271
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,发现更多精彩内容 >>
提交
b0283271
编写于
5月 12, 2003
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid unnecessary copying of parameter values in BIND. This allows
efficient insertion of large bytea values through the BIND interface.
上级
d97c9b36
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
27 addition
and
19 deletion
+27
-19
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+27
-19
未找到文件。
src/backend/tcop/postgres.c
浏览文件 @
b0283271
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.34
2 2003/05/09 18:08:48
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.34
3 2003/05/12 16:48:17
tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -1265,13 +1265,9 @@ exec_bind_message(StringInfo input_message)
if
(
numParams
>
0
)
{
bool
isaborted
=
IsAbortedTransactionBlockState
();
StringInfoData
pbuf
;
List
*
l
;
MemoryContext
oldContext
;
/* Note that the string buffer lives in MessageContext */
initStringInfo
(
&
pbuf
);
oldContext
=
MemoryContextSwitchTo
(
PortalGetHeapMemory
(
portal
));
params
=
(
ParamListInfo
)
...
...
@@ -1289,14 +1285,7 @@ exec_bind_message(StringInfo input_message)
if
(
!
isNull
)
{
/* Reset pbuf to empty, and insert raw data into it */
pbuf
.
len
=
0
;
pbuf
.
data
[
0
]
=
'\0'
;
pbuf
.
cursor
=
0
;
appendBinaryStringInfo
(
&
pbuf
,
pq_getmsgbytes
(
input_message
,
plength
),
plength
);
const
char
*
pvalue
=
pq_getmsgbytes
(
input_message
,
plength
);
if
(
isaborted
)
{
...
...
@@ -1306,6 +1295,8 @@ exec_bind_message(StringInfo input_message)
else
{
int16
pformat
;
StringInfoData
pbuf
;
char
csave
;
if
(
numPFormats
>
1
)
pformat
=
pformats
[
i
];
...
...
@@ -1314,6 +1305,23 @@ exec_bind_message(StringInfo input_message)
else
pformat
=
0
;
/* default = text */
/*
* Rather than copying data around, we just set up a phony
* StringInfo pointing to the correct portion of the
* message buffer. We assume we can scribble on the
* message buffer so as to maintain the convention that
* StringInfos have a trailing null. This is grotty but
* is a big win when dealing with very large parameter
* strings.
*/
pbuf
.
data
=
(
char
*
)
pvalue
;
pbuf
.
maxlen
=
plength
+
1
;
pbuf
.
len
=
plength
;
pbuf
.
cursor
=
0
;
csave
=
pbuf
.
data
[
plength
];
pbuf
.
data
[
plength
]
=
'\0'
;
if
(
pformat
==
0
)
{
Oid
typInput
;
...
...
@@ -1322,11 +1330,8 @@ exec_bind_message(StringInfo input_message)
getTypeInputInfo
(
ptype
,
&
typInput
,
&
typElem
);
/*
* Since stringinfo.c keeps a trailing null in
* place even for binary data, the contents of
* pbuf are a valid C string. We have to do
* encoding conversion before calling the typinput
* routine, though.
* We have to do encoding conversion before calling
* the typinput routine.
*/
pstring
=
(
char
*
)
pg_client_to_server
((
unsigned
char
*
)
pbuf
.
data
,
...
...
@@ -1362,6 +1367,9 @@ exec_bind_message(StringInfo input_message)
{
elog
(
ERROR
,
"Invalid format code %d"
,
pformat
);
}
/* Restore message buffer contents */
pbuf
.
data
[
plength
]
=
csave
;
}
}
...
...
@@ -2524,7 +2532,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.34
2 $ $Date: 2003/05/09 18:08:48
$
\n
"
);
puts
(
"$Revision: 1.34
3 $ $Date: 2003/05/12 16:48:17
$
\n
"
);
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录