Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
122923c9
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,发现更多精彩内容 >>
提交
122923c9
编写于
4月 25, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Still had a few MULTIBYTE problems when client encoding was
different from database's ...
上级
0d99c953
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
9 deletion
+40
-9
src/backend/libpq/pqformat.c
src/backend/libpq/pqformat.c
+31
-2
src/backend/tcop/dest.c
src/backend/tcop/dest.c
+3
-3
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+3
-3
src/include/libpq/pqformat.h
src/include/libpq/pqformat.h
+3
-1
未找到文件。
src/backend/libpq/pqformat.c
浏览文件 @
122923c9
...
...
@@ -15,13 +15,13 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pqformat.c,v 1.
2 1999/04/25 19:27:44
tgl Exp $
* $Id: pqformat.c,v 1.
3 1999/04/25 21:50:56
tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* INTERFACE ROUTINES
* Message output:
* Message
assembly and
output:
* pq_beginmessage - initialize StringInfo buffer
* pq_sendbyte - append a raw byte to a StringInfo buffer
* pq_sendint - append a binary integer to a StringInfo buffer
...
...
@@ -33,6 +33,9 @@
* the regular StringInfo routines, but this is discouraged since required
* MULTIBYTE conversion may not occur.
*
* Special-case message output:
* pq_puttextmessage - generate a MULTIBYTE-converted message in one step
*
* Message input:
* pq_getint - get an integer from connection
* pq_getstr - get a null terminated string from connection
...
...
@@ -209,6 +212,32 @@ pq_endmessage(StringInfo buf)
buf
->
data
=
NULL
;
}
/* --------------------------------
* pq_puttextmessage - generate a MULTIBYTE-converted message in one step
*
* This is the same as the pqcomm.c routine pq_putmessage, except that
* the message body is a null-terminated string to which MULTIBYTE
* conversion applies.
*
* returns 0 if OK, EOF if trouble
* --------------------------------
*/
int
pq_puttextmessage
(
char
msgtype
,
const
char
*
str
)
{
int
slen
=
strlen
(
str
);
#ifdef MULTIBYTE
const
char
*
p
;
p
=
(
const
char
*
)
pg_server_to_client
((
unsigned
char
*
)
str
,
slen
);
if
(
p
!=
str
)
/* actual conversion has been done? */
{
str
=
p
;
slen
=
strlen
(
str
);
}
#endif
return
pq_putmessage
(
msgtype
,
str
,
slen
+
1
);
}
/* --------------------------------
* pq_getint - get an integer from connection
*
...
...
src/backend/tcop/dest.c
浏览文件 @
122923c9
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.2
7 1999/04/25 19:27:45
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.2
8 1999/04/25 21:50:57
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -138,7 +138,7 @@ BeginCommand(char *pname,
* send fe info on tuples we're about to send
* ----------------
*/
pq_put
message
(
'P'
,
pname
,
strlen
(
pname
)
+
1
);
pq_put
textmessage
(
'P'
,
pname
);
/* ----------------
* if this is a retrieve, then we send back the tuple
...
...
@@ -272,7 +272,7 @@ EndCommand(char *commandTag, CommandDest dest)
* ----------------
*/
sprintf
(
buf
,
"%s%s"
,
commandTag
,
CommandInfo
);
pq_put
message
(
'C'
,
buf
,
strlen
(
buf
)
+
1
);
pq_put
textmessage
(
'C'
,
buf
);
CommandInfo
[
0
]
=
'\0'
;
break
;
...
...
src/backend/utils/error/elog.c
浏览文件 @
122923c9
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.4
2 1999/04/25 03:19:11
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.4
3 1999/04/25 21:50:57
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,6 +31,7 @@
#include "postgres.h"
#include "miscadmin.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/trace.h"
...
...
@@ -201,8 +202,7 @@ elog(int lev, const char *fmt,...)
msgtype
=
'E'
;
}
/* exclude the timestamp from msg sent to frontend */
pq_putmessage
(
msgtype
,
line
+
TIMESTAMP_SIZE
,
strlen
(
line
+
TIMESTAMP_SIZE
)
+
1
);
pq_puttextmessage
(
msgtype
,
line
+
TIMESTAMP_SIZE
);
/*
* This flush is normally not necessary, since postgres.c will
* flush out waiting data when control returns to the main loop.
...
...
src/include/libpq/pqformat.h
浏览文件 @
122923c9
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pqformat.h,v 1.
2 1999/04/25 19:27:47
tgl Exp $
* $Id: pqformat.h,v 1.
3 1999/04/25 21:50:58
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,6 +24,8 @@ extern void pq_sendstring(StringInfo buf, const char *str);
extern
void
pq_sendint
(
StringInfo
buf
,
int
i
,
int
b
);
extern
void
pq_endmessage
(
StringInfo
buf
);
extern
int
pq_puttextmessage
(
char
msgtype
,
const
char
*
str
);
extern
int
pq_getint
(
int
*
result
,
int
b
);
extern
int
pq_getstr
(
char
*
s
,
int
maxlen
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录