Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
eb191448
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,发现更多精彩内容 >>
提交
eb191448
编写于
2月 11, 2007
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for optionally escaping periods when converting SQL identifiers
to XML names, which will be required for supporting XML export.
上级
733abd29
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
8 deletion
+16
-8
src/backend/parser/parse_expr.c
src/backend/parser/parse_expr.c
+4
-4
src/backend/utils/adt/xml.c
src/backend/utils/adt/xml.c
+10
-2
src/include/utils/xml.h
src/include/utils/xml.h
+2
-2
未找到文件。
src/backend/parser/parse_expr.c
浏览文件 @
eb191448
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.21
0 2007/02/03 14:06:54
petere Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.21
1 2007/02/11 22:18:15
petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1389,7 +1389,7 @@ transformXmlExpr(ParseState *pstate, XmlExpr *x)
newx
->
op
=
x
->
op
;
if
(
x
->
name
)
newx
->
name
=
map_sql_identifier_to_xml_name
(
x
->
name
,
false
);
newx
->
name
=
map_sql_identifier_to_xml_name
(
x
->
name
,
false
,
false
);
else
newx
->
name
=
NULL
;
...
...
@@ -1411,10 +1411,10 @@ transformXmlExpr(ParseState *pstate, XmlExpr *x)
expr
=
transformExpr
(
pstate
,
r
->
val
);
if
(
r
->
name
)
argname
=
map_sql_identifier_to_xml_name
(
r
->
name
,
false
);
argname
=
map_sql_identifier_to_xml_name
(
r
->
name
,
false
,
false
);
else
if
(
IsA
(
r
->
val
,
ColumnRef
))
argname
=
map_sql_identifier_to_xml_name
(
FigureColname
(
r
->
val
),
true
);
true
,
false
);
else
{
ereport
(
ERROR
,
...
...
src/backend/utils/adt/xml.c
浏览文件 @
eb191448
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.2
6 2007/02/10 18:47:41
petere Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.2
7 2007/02/11 22:18:15
petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1318,8 +1318,14 @@ is_valid_xml_namechar(pg_wchar c)
* Map SQL identifier to XML name; see SQL/XML:2003 section 9.1.
*/
char
*
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
)
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
,
bool
escape_period
)
{
/*
* SQL/XML doesn't make use of this case anywhere, so it's
* probably a mistake.
*/
Assert
(
fully_escaped
||
!
escape_period
);
#ifdef USE_LIBXML
StringInfoData
buf
;
char
*
p
;
...
...
@@ -1340,6 +1346,8 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped)
else
appendStringInfo
(
&
buf
,
"_x0058_"
);
}
else
if
(
escape_period
&&
*
p
==
'.'
)
appendStringInfo
(
&
buf
,
"_x002E_"
);
else
{
pg_wchar
u
=
sqlchar_to_unicode
(
p
);
...
...
src/include/utils/xml.h
浏览文件 @
eb191448
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.1
4 2007/02/03 14:06:5
6 petere Exp $
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.1
5 2007/02/11 22:18:1
6 petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,7 +53,7 @@ extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
extern
bool
xml_is_document
(
xmltype
*
arg
);
extern
text
*
xmltotext_with_xmloption
(
xmltype
*
data
,
XmlOptionType
xmloption_arg
);
extern
char
*
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
);
extern
char
*
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
,
bool
escape_period
);
extern
char
*
map_xml_name_to_sql_identifier
(
char
*
name
);
extern
char
*
map_sql_value_to_xml_value
(
Datum
value
,
Oid
type
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录