Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b35795

Browse files
committed
Use XML output escaping also in XMLFOREST.
1 parent92dffbd commit8b35795

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

‎src/backend/executor/execQual.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.205 2007/01/10 20:33:54 petere Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.206 2007/01/12 21:47:26 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2692,11 +2692,10 @@ ExecEvalXml(XmlExprState *xmlExpr, ExprContext *econtext,
26922692
value=ExecEvalExpr(e,econtext,&isnull,NULL);
26932693
if (!isnull)
26942694
{
2695-
str=OutputFunctionCall(&xmlExpr->named_outfuncs[i],
2696-
value);
26972695
appendStringInfo(&buf,"<%s>%s</%s>",
2698-
argname,str,argname);
2699-
pfree(str);
2696+
argname,
2697+
map_sql_value_to_xml_value(value,exprType((Node*)e->expr)),
2698+
argname);
27002699
*isNull= false;
27012700
}
27022701
i++;

‎src/backend/utils/adt/xml.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.15 2007/01/1216:29:24 petere Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.16 2007/01/1221:47:26 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -70,8 +70,6 @@ static void xml_ereport_by_code(int level, int sqlcode,
7070
staticxmlChar*xml_text2xmlChar(text*in);
7171
staticxmlDocPtrxml_parse(text*data,boolis_document,boolpreserve_whitespace);
7272

73-
staticchar*map_sql_value_to_xml_value(Datumvalue,Oidtype);
74-
7573
#endif/* USE_LIBXML */
7674

7775
#defineNO_XML_SUPPORT() \
@@ -1260,11 +1258,10 @@ map_xml_name_to_sql_identifier(char *name)
12601258
}
12611259

12621260

1263-
#ifdefUSE_LIBXML
12641261
/*
12651262
* Map SQL value to XML value; see SQL/XML:2003 section 9.16.
12661263
*/
1267-
staticchar*
1264+
char*
12681265
map_sql_value_to_xml_value(Datumvalue,Oidtype)
12691266
{
12701267
StringInfoDatabuf;
@@ -1341,4 +1338,3 @@ map_sql_value_to_xml_value(Datum value, Oid type)
13411338

13421339
returnbuf.data;
13431340
}
1344-
#endif/* USE_LIBXML */

‎src/include/utils/xml.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.8 2007/01/10 20:33:54 petere Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.9 2007/01/12 21:47:27 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -40,5 +40,6 @@ extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
4040

4141
externchar*map_sql_identifier_to_xml_name(char*ident,boolfully_escaped);
4242
externchar*map_xml_name_to_sql_identifier(char*name);
43+
externchar*map_sql_value_to_xml_value(Datumvalue,Oidtype);
4344

4445
#endif/* XML_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp