Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fa0f2416
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,发现更多精彩内容 >>
提交
fa0f2416
编写于
2月 07, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add PQresStatus() function to avoid direct access to pgresStatus[] array,
making life easier for Windoids...
上级
f2802669
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
11 deletion
+23
-11
src/interfaces/libpgtcl/pgtclCmds.c
src/interfaces/libpgtcl/pgtclCmds.c
+2
-2
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+10
-1
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-fe.h
+9
-7
src/interfaces/libpq/libpqdll.def
src/interfaces/libpq/libpqdll.def
+1
-0
src/test/examples/testlibpq2.c
src/test/examples/testlibpq2.c
+1
-1
未找到文件。
src/interfaces/libpgtcl/pgtclCmds.c
浏览文件 @
fa0f2416
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.
39 1999/01/17 21:12:55
tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.
40 1999/02/07 22:08:51
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -545,7 +545,7 @@ Pg_result(ClientData cData, Tcl_Interp * interp, int argc, char *argv[])
...
@@ -545,7 +545,7 @@ Pg_result(ClientData cData, Tcl_Interp * interp, int argc, char *argv[])
if
(
strcmp
(
opt
,
"-status"
)
==
0
)
if
(
strcmp
(
opt
,
"-status"
)
==
0
)
{
{
Tcl_AppendResult
(
interp
,
pgresStatus
[
PQresultStatus
(
result
)]
,
0
);
Tcl_AppendResult
(
interp
,
PQresStatus
(
PQresultStatus
(
result
))
,
0
);
return
TCL_OK
;
return
TCL_OK
;
}
}
else
if
(
strcmp
(
opt
,
"-error"
)
==
0
)
else
if
(
strcmp
(
opt
,
"-error"
)
==
0
)
...
...
src/interfaces/libpq/fe-exec.c
浏览文件 @
fa0f2416
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.7
2 1999/02/03 20:19:10 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.7
3 1999/02/07 22:08:52 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1518,6 +1518,15 @@ PQresultStatus(PGresult *res)
...
@@ -1518,6 +1518,15 @@ PQresultStatus(PGresult *res)
return
res
->
resultStatus
;
return
res
->
resultStatus
;
}
}
const
char
*
PQresStatus
(
ExecStatusType
status
)
{
if
(((
int
)
status
)
<
0
||
((
int
)
status
)
>=
(
sizeof
(
pgresStatus
)
/
sizeof
(
pgresStatus
[
0
])))
return
"Invalid ExecStatusType code"
;
return
pgresStatus
[
status
];
}
const
char
*
const
char
*
PQresultErrorMessage
(
PGresult
*
res
)
PQresultErrorMessage
(
PGresult
*
res
)
{
{
...
...
src/interfaces/libpq/libpq-fe.h
浏览文件 @
fa0f2416
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: libpq-fe.h,v 1.4
7 1999/02/05 04:25:55 momjian
Exp $
* $Id: libpq-fe.h,v 1.4
8 1999/02/07 22:08:53 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -49,7 +49,9 @@ extern "C"
...
@@ -49,7 +49,9 @@ extern "C"
PGRES_FATAL_ERROR
PGRES_FATAL_ERROR
}
ExecStatusType
;
}
ExecStatusType
;
/* String descriptions of the ExecStatusTypes */
/* String descriptions of the ExecStatusTypes.
* NB: direct use of this array is now deprecated; call PQresStatus() instead.
*/
extern
const
char
*
const
pgresStatus
[];
extern
const
char
*
const
pgresStatus
[];
/* PGconn encapsulates a connection to the backend.
/* PGconn encapsulates a connection to the backend.
...
@@ -79,7 +81,6 @@ extern "C"
...
@@ -79,7 +81,6 @@ extern "C"
/* PQnoticeProcessor is the function type for the notice-message callback.
/* PQnoticeProcessor is the function type for the notice-message callback.
*/
*/
typedef
void
(
*
PQnoticeProcessor
)
(
void
*
arg
,
const
char
*
message
);
typedef
void
(
*
PQnoticeProcessor
)
(
void
*
arg
,
const
char
*
message
);
/* Print options for PQprint() */
/* Print options for PQprint() */
...
@@ -153,8 +154,8 @@ extern "C"
...
@@ -153,8 +154,8 @@ extern "C"
extern
PGconn
*
PQconnectdb
(
const
char
*
conninfo
);
extern
PGconn
*
PQconnectdb
(
const
char
*
conninfo
);
extern
PGconn
*
PQsetdbLogin
(
const
char
*
pghost
,
const
char
*
pgport
,
extern
PGconn
*
PQsetdbLogin
(
const
char
*
pghost
,
const
char
*
pgport
,
const
char
*
pgoptions
,
const
char
*
pgtty
,
const
char
*
pgoptions
,
const
char
*
pgtty
,
const
char
*
dbName
,
const
char
*
dbName
,
const
char
*
login
,
const
char
*
pwd
);
const
char
*
login
,
const
char
*
pwd
);
#define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \
#define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \
PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
...
@@ -192,8 +193,8 @@ extern "C"
...
@@ -192,8 +193,8 @@ extern "C"
/* Override default notice processor */
/* Override default notice processor */
extern
void
PQsetNoticeProcessor
(
PGconn
*
conn
,
extern
void
PQsetNoticeProcessor
(
PGconn
*
conn
,
PQnoticeProcessor
proc
,
PQnoticeProcessor
proc
,
void
*
arg
);
void
*
arg
);
/* === in fe-exec.c === */
/* === in fe-exec.c === */
...
@@ -230,6 +231,7 @@ extern "C"
...
@@ -230,6 +231,7 @@ extern "C"
/* Accessor functions for PGresult objects */
/* Accessor functions for PGresult objects */
extern
ExecStatusType
PQresultStatus
(
PGresult
*
res
);
extern
ExecStatusType
PQresultStatus
(
PGresult
*
res
);
extern
const
char
*
PQresStatus
(
ExecStatusType
status
);
extern
const
char
*
PQresultErrorMessage
(
PGresult
*
res
);
extern
const
char
*
PQresultErrorMessage
(
PGresult
*
res
);
extern
int
PQntuples
(
PGresult
*
res
);
extern
int
PQntuples
(
PGresult
*
res
);
extern
int
PQnfields
(
PGresult
*
res
);
extern
int
PQnfields
(
PGresult
*
res
);
...
...
src/interfaces/libpq/libpqdll.def
浏览文件 @
fa0f2416
...
@@ -66,3 +66,4 @@ EXPORTS
...
@@ -66,3 +66,4 @@ EXPORTS
pgresStatus @ 63
pgresStatus @ 63
PQmblen @ 64
PQmblen @ 64
PQresultErrorMessage @ 65
PQresultErrorMessage @ 65
PQresStatus @ 66
src/test/examples/testlibpq2.c
浏览文件 @
fa0f2416
...
@@ -90,7 +90,7 @@ main()
...
@@ -90,7 +90,7 @@ main()
/* async notification only come back as a result of a query */
/* async notification only come back as a result of a query */
/* we can send empty queries */
/* we can send empty queries */
res
=
PQexec
(
conn
,
" "
);
res
=
PQexec
(
conn
,
" "
);
/* printf("res->status = %s\n",
pgresStatus[PQresultStatus(res)]
); */
/* printf("res->status = %s\n",
PQresStatus(PQresultStatus(res))
); */
/* check for asynchronous returns */
/* check for asynchronous returns */
notify
=
PQnotifies
(
conn
);
notify
=
PQnotifies
(
conn
);
if
(
notify
)
if
(
notify
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录