postgresql/src
Tom Lane edb5143063 Fix EXPLAIN so that it doesn't emit invalid XML in corner cases.
With track_io_timing = on, EXPLAIN (ANALYZE, BUFFERS) will emit fields
named like "I/O Read Time".  The slash makes that invalid as an XML
element name, so that adding FORMAT XML would produce invalid XML.

We already have code in there to translate spaces to dashes, so let's
generalize that to convert anything that isn't a valid XML name character,
viz letters, digits, hyphens, underscores, and periods.  We could just
reject slashes, which would run a bit faster.  But the fact that this went
unnoticed for so long doesn't give me a warm feeling that we'd notice the
next creative violation, so let's make it a permanent fix.

Reported by Markus Winand, though this isn't his initial patch proposal.

Back-patch to 9.2 where track_io_timing was added.  The problem is only
latent in 9.1, so I don't feel a need to fix it there.

Discussion: <E0BF6A45-68E8-45E6-918F-741FB332C6BB@winand.at>
2016-10-20 17:18:09 -04:00
..
backend Fix EXPLAIN so that it doesn't emit invalid XML in corner cases. 2016-10-20 17:18:09 -04:00
bin Include <sys/select.h> where needed 2016-09-27 01:05:21 -03:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:39 -05:00
include Fix copy-pasto in comment. 2016-10-12 12:09:05 +03:00
interfaces In PQsendQueryStart(), avoid leaking any left-over async result. 2016-10-10 10:35:58 -04:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:32 -05:00
pl Translation updates 2016-08-08 10:53:45 -04:00
port Include <sys/select.h> where needed 2016-09-27 01:05:21 -03:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:02:03 -04:00
test Fix another bug in merging of inherited CHECK constraints. 2016-10-13 17:05:15 -04:00
timezone Sync our copy of the timezone library with IANA release tzcode2016h. 2016-10-20 15:40:26 -04:00
tools Remove vestigial references to "zic" in favor of "IANA database". 2016-09-04 19:42:40 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Make numeric form of PG version number readily available in Makefiles. 2015-07-05 12:01:01 -04:00
Makefile.shlib Make the AIX case of Makefile.shlib safe for parallel make. 2016-07-23 20:30:48 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00