]> granicus.if.org Git - postgresql/commitdiff
Fix map_sql_value_to_xml_value() to treat domains like their base types.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Mar 2013 00:32:12 +0000 (19:32 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Mar 2013 00:32:22 +0000 (19:32 -0500)
This was already the case for domains over arrays, but not for domains
over certain built-in types such as boolean.  The special formatting
rules for those types should apply to domains over them as well.
Per discussion.

While this is a bug fix, it's also a behavioral change that seems likely
to trip up some applications.  So no back-patch.

Pavel Stehule

src/backend/utils/adt/xml.c

index d5d48d5c060e18e20c40cab65a10b54158a4976a..9c5daec31e96543b75bbe1a654f31a5e01c0fb74 100644 (file)
@@ -2001,6 +2001,12 @@ map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings)
                bool            isvarlena;
                char       *str;
 
+               /*
+                * Flatten domains; the special-case treatments below should apply
+                * to, eg, domains over boolean not just boolean.
+                */
+               type = getBaseType(type);
+
                /*
                 * Special XSD formatting for some data types
                 */