On Tue, Feb 13, 2007 at 04:29:16PM +0100, Magnus Hagander wrote: > The latest set of XML changes (I think latest, at least fairly recent) > broke the win32vc build with asserts enabled. The line: > Assert(fully_escaped || !escape_period); > > From what I can tell, this is because the Assert() puts code (the do {} > loop) *before* the declaration of StringInfoData buf, which is not > permitted. > > Attached patch seems to fix this. Can someone confirm this is correct > before I put it in?
I just realised I should of course move the comment as well :-) Thus, the attached patch is more correct. //Magnus
Index: src/backend/utils/adt/xml.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/xml.c,v retrieving revision 1.27 diff -c -r1.27 xml.c *** src/backend/utils/adt/xml.c 11 Feb 2007 22:18:15 -0000 1.27 --- src/backend/utils/adt/xml.c 13 Feb 2007 15:38:16 -0000 *************** *** 1320,1335 **** char * 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; - initStringInfo(&buf); for (p = ident; *p; p += pg_mblen(p)) --- 1320,1335 ---- char * map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, bool escape_period) { + #ifdef USE_LIBXML + StringInfoData buf; + char *p; + /* * SQL/XML doesn't make use of this case anywhere, so it's * probably a mistake. */ Assert(fully_escaped || !escape_period); initStringInfo(&buf); for (p = ident; *p; p += pg_mblen(p))
---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings