mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Use XML output escaping also in XMLFOREST.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.205 2007/01/10 20:33:54 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.206 2007/01/12 21:47:26 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2692,11 +2692,10 @@ ExecEvalXml(XmlExprState *xmlExpr, ExprContext *econtext,
|
||||
value = ExecEvalExpr(e, econtext, &isnull, NULL);
|
||||
if (!isnull)
|
||||
{
|
||||
str = OutputFunctionCall(&xmlExpr->named_outfuncs[i],
|
||||
value);
|
||||
appendStringInfo(&buf, "<%s>%s</%s>",
|
||||
argname, str, argname);
|
||||
pfree(str);
|
||||
argname,
|
||||
map_sql_value_to_xml_value(value, exprType((Node *) e->expr)),
|
||||
argname);
|
||||
*isNull = false;
|
||||
}
|
||||
i++;
|
||||
|
||||
@@ -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.15 2007/01/12 16:29:24 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.16 2007/01/12 21:47:26 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -70,8 +70,6 @@ static void xml_ereport_by_code(int level, int sqlcode,
|
||||
static xmlChar *xml_text2xmlChar(text *in);
|
||||
static xmlDocPtr xml_parse(text *data, bool is_document, bool preserve_whitespace);
|
||||
|
||||
static char *map_sql_value_to_xml_value(Datum value, Oid type);
|
||||
|
||||
#endif /* USE_LIBXML */
|
||||
|
||||
#define NO_XML_SUPPORT() \
|
||||
@@ -1260,11 +1258,10 @@ map_xml_name_to_sql_identifier(char *name)
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_LIBXML
|
||||
/*
|
||||
* Map SQL value to XML value; see SQL/XML:2003 section 9.16.
|
||||
*/
|
||||
static char *
|
||||
char *
|
||||
map_sql_value_to_xml_value(Datum value, Oid type)
|
||||
{
|
||||
StringInfoData buf;
|
||||
@@ -1341,4 +1338,3 @@ map_sql_value_to_xml_value(Datum value, Oid type)
|
||||
|
||||
return buf.data;
|
||||
}
|
||||
#endif /* USE_LIBXML */
|
||||
|
||||
Reference in New Issue
Block a user