forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit709e461
committed
Fix EXPLAIN so that it doesn't emit invalid XML in corner cases.
With track_io_timing = on, EXPLAIN (ANALYZE, BUFFERS) will emit fieldsnamed like "I/O Read Time". The slash makes that invalid as an XMLelement name, so that adding FORMAT XML would produce invalid XML.We already have code in there to translate spaces to dashes, so let'sgeneralize that to convert anything that isn't a valid XML name character,viz letters, digits, hyphens, underscores, and periods. We could justreject slashes, which would run a bit faster. But the fact that this wentunnoticed for so long doesn't give me a warm feeling that we'd notice thenext 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 onlylatent in 9.1, so I don't feel a need to fix it there.Discussion: <E0BF6A45-68E8-45E6-918F-741FB332C6BB@winand.at>1 parent5e21b68 commit709e461
1 file changed
+5
-3
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3312 | 3312 |
| |
3313 | 3313 |
| |
3314 | 3314 |
| |
3315 |
| - | |
3316 |
| - | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
3317 | 3318 |
| |
3318 | 3319 |
| |
3319 | 3320 |
| |
3320 | 3321 |
| |
3321 | 3322 |
| |
| 3323 | + | |
3322 | 3324 |
| |
3323 | 3325 |
| |
3324 | 3326 |
| |
3325 | 3327 |
| |
3326 | 3328 |
| |
3327 | 3329 |
| |
3328 | 3330 |
| |
3329 |
| - | |
| 3331 | + | |
3330 | 3332 |
| |
3331 | 3333 |
| |
3332 | 3334 |
| |
|
0 commit comments
Comments
(0)