Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4540a8bd
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,发现更多精彩内容 >>
提交
4540a8bd
编写于
12月 20, 1996
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix multiple "C" from backend.
上级
a952d672
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
46 deletion
+20
-46
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+20
-46
未找到文件。
src/interfaces/libpq/fe-exec.c
浏览文件 @
4540a8bd
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.2
1 1996/12/15 09:05:53 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.2
2 1996/12/20 20:34:38 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -362,16 +362,13 @@ PGresult*
PQexec
(
PGconn
*
conn
,
const
char
*
query
)
{
PGresult
*
result
;
int
id
,
clear
,
error
;
int
id
;
char
buffer
[
MAX_MESSAGE_LEN
];
char
cmdStatus
[
MAX_MESSAGE_LEN
];
char
pname
[
MAX_MESSAGE_LEN
];
/* portal name */
PGnotify
*
newNotify
;
FILE
*
pfin
,
*
pfout
,
*
pfdebug
;
#ifdef PQ_NOTIFY_PATCH
int
isCommand
=
0
;
/* DZ - 31-8-1996 */
#endif
int
emptiesSent
=
0
;
pname
[
0
]
=
'\0'
;
...
...
@@ -412,7 +409,7 @@ PQexec(PGconn* conn, const char* query)
"-- fprintf to Pfout failed: errno=%d
\n
%s
\n
"
,
query
,
errno
,
strerror
(
errno
));
return
NULL
;
}
}
/* loop forever because multiple messages, especially NOTICES,
can come back from the backend
...
...
@@ -458,38 +455,12 @@ PQexec(PGconn* conn, const char* query)
// send an empty query down, and keep reading out of the pipe
// until an 'I' is received.
*/
clear
=
0
;
error
=
0
;
pqPuts
(
"Q "
,
pfout
,
pfdebug
);
/* send an empty query */
#ifdef PQ_NOTIFY_PATCH
/*
*
Se
t a flag and process messages in the usual way because
*
Incremen
t a flag and process messages in the usual way because
* there may be async notifications pending. DZ - 31-8-1996
*/
isCommand
=
1
;
#else
while
(
!
clear
)
{
if
(
pqGets
(
buffer
,
ERROR_MSG_LENGTH
,
pfin
,
pfdebug
)
==
1
)
clear
=
1
;
/*
// Rules can create error messages while we are waiting
// for the 'I'.
*/
if
(
buffer
[
0
]
==
'E'
)
{
strcpy
(
conn
->
errorMessage
,
&
buffer
[
1
]);
error
++
;
}
clear
=
(
buffer
[
0
]
==
'I'
);
}
if
(
error
)
{
return
(
PGresult
*
)
NULL
;
}
result
=
makeEmptyPGresult
(
conn
,
PGRES_COMMAND_OK
);
strncpy
(
result
->
cmdStatus
,
cmdStatus
,
CMDSTATUS_LEN
-
1
);
return
result
;
#endif
emptiesSent
++
;
}
break
;
case
'E'
:
/* error return */
...
...
@@ -507,17 +478,21 @@ PQexec(PGconn* conn, const char* query)
if
((
c
=
pqGetc
(
pfin
,
pfdebug
))
!=
'\0'
)
{
fprintf
(
stderr
,
"error!, unexpected character %c following 'I'
\n
"
,
c
);
}
if
(
isCommand
)
{
/*
* If this is the result of a portal query command set the
* command status and message accordingly. DZ - 31-8-1996
*/
result
=
makeEmptyPGresult
(
conn
,
PGRES_COMMAND_OK
);
strncpy
(
result
->
cmdStatus
,
cmdStatus
,
CMDSTATUS_LEN
-
1
);
if
(
emptiesSent
)
{
if
(
--
emptiesSent
==
0
)
{
/* is this the last one? */
/*
* If this is the result of a portal query command set the
* command status and message accordingly. DZ - 31-8-1996
*/
result
=
makeEmptyPGresult
(
conn
,
PGRES_COMMAND_OK
);
strncpy
(
result
->
cmdStatus
,
cmdStatus
,
CMDSTATUS_LEN
-
1
);
return
result
;
}
}
else
{
result
=
makeEmptyPGresult
(
conn
,
PGRES_EMPTY_QUERY
);
return
result
;
}
result
=
makeEmptyPGresult
(
conn
,
PGRES_EMPTY_QUERY
);
return
result
;
}
break
;
case
'N'
:
/* notices from the backend */
...
...
@@ -548,8 +523,7 @@ PQexec(PGconn* conn, const char* query)
id
);
return
(
PGresult
*
)
NULL
;
}
/* switch */
}
/* while (1)*/
}
/* while (1)*/
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录