postgresql/src/backend
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
..
access Fix WAL-logging of FSM and VM truncation. 2016-10-19 15:00:34 +03:00
bootstrap Protect against multixact members wraparound 2015-04-28 11:32:53 -03:00
catalog Fix another bug in merging of inherited CHECK constraints. 2016-10-13 17:05:15 -04:00
commands Fix EXPLAIN so that it doesn't emit invalid XML in corner cases. 2016-10-20 17:18:09 -04:00
executor Be sure to rewind the tuplestore read pointer in non-leader CTEScan nodes. 2016-09-22 11:34:44 -04:00
foreign Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
lib Misc comment typo fixes. 2014-12-16 16:39:33 +02:00
libpq Include <sys/select.h> where needed 2016-09-27 01:05:21 -03:00
main Make fallback implementation of pg_memory_barrier() work in 9.2 and 9.3. 2016-04-16 10:42:07 -04:00
nodes Fix improper repetition of previous results from a hashed aggregate. 2016-08-24 14:37:51 -04:00
optimizer Fix improper repetition of previous results from a hashed aggregate. 2016-08-24 14:37:51 -04:00
parser Improve documentation about CREATE TABLE ... LIKE. 2016-07-28 13:26:59 -04:00
po Translation updates 2016-08-08 10:53:45 -04:00
port Improve TranslateSocketError() to handle more Windows error codes. 2016-04-21 16:59:08 -04:00
postmaster Do ClosePostmasterPorts() earlier in SubPostmasterMain(). 2016-10-01 17:15:10 -04:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:11:52 -05:00
replication Fix typos 2016-02-29 18:11:58 -03:00
rewrite Improve error message for rejecting RETURNING clauses with dropped columns. 2016-02-29 19:11:53 -05:00
snowball Fix ancient encoding error in hungarian.stop. 2014-06-10 22:48:39 -04:00
storage Fix WAL-logging of FSM and VM truncation. 2016-10-19 15:00:34 +03:00
tcop Be more predictable about reporting "lock timeout" vs "statement timeout". 2016-05-27 10:40:20 -04:00
tsearch Fix misestimation of n_distinct for a nearly-unique column with many nulls. 2016-08-07 18:52:02 -04:00
utils Suppress "Factory" zone in pg_timezone_names view for tzdata >= 2016g. 2016-10-19 18:12:09 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile AIX: Link the postgres executable with -Wl,-brtllib. 2015-07-15 21:00:30 -04:00
nls.mk xlogreader.c: Fix report_invalid_record translatability flag 2015-01-09 12:34:24 -03:00