mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
XMLATTRIBUTES() should send the attribute values through
map_sql_value_to_xml_value() instead of directly through the data type output function. This is per SQL standard, and consistent with XMLELEMENT().
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.85 2009/03/27 18:56:57 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.86 2009/04/08 21:51:38 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -572,7 +572,7 @@ xmlelement(XmlExprState *xmlExpr, ExprContext *econtext)
|
||||
if (isnull)
|
||||
str = NULL;
|
||||
else
|
||||
str = OutputFunctionCall(&xmlExpr->named_outfuncs[i], value);
|
||||
str = map_sql_value_to_xml_value(value, exprType((Node *) e->expr));
|
||||
named_arg_strings = lappend(named_arg_strings, str);
|
||||
i++;
|
||||
}
|
||||
@ -609,12 +609,9 @@ xmlelement(XmlExprState *xmlExpr, ExprContext *econtext)
|
||||
char *argname = strVal(lfirst(narg));
|
||||
|
||||
if (str)
|
||||
{
|
||||
xmlTextWriterWriteAttribute(writer,
|
||||
(xmlChar *) argname,
|
||||
(xmlChar *) str);
|
||||
pfree(str);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(arg, arg_strings)
|
||||
|
Reference in New Issue
Block a user