aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-11-19 14:26:19 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-11-19 14:26:19 -0500
commit13671b4b22ae4bd345c62e7c0b41d717b8a2e19b (patch)
tree7b7771ec32c62a20feade5ff5629d5108dfb02dd /src/backend/parser/parse_target.c
parent67dc4ccbb2e1c27da823eced66d9217a5652cbb0 (diff)
downloadpostgresql-13671b4b22ae4bd345c62e7c0b41d717b8a2e19b.tar.gz
postgresql-13671b4b22ae4bd345c62e7c0b41d717b8a2e19b.zip
Code review for GUC serialization/deserialization code.
The serialization code dumped core for a string-valued GUC whose value is NULL, which is a legal state. The infrastructure isn't capable of transmitting that state exactly, but fortunately, transmitting an empty string instead should be close enough (compare, eg, commit e45e990e4). The code potentially underestimated the space required to format a real-valued variable, both because it made an unwarranted assumption that %g output would never be longer than %e output, and because it didn't count right even for %e format. In practice this would pretty much always be masked by overestimates for other variables, but it's still wrong. Also fix boundary-case error in read_gucstate, incorrect handling of the case where guc_sourcefile is non-NULL but zero length (not clear that can happen, but if it did, this code would get totally confused), and confusingly useless check for a NULL result from read_gucstate. Andreas Seltenreich discovered the core dump; other issues noted while reading nearby code. Back-patch to 9.5 where this code was introduced. Michael Paquier and Tom Lane Discussion: <871sy78wno.fsf@credativ.de>
Diffstat (limited to 'src/backend/parser/parse_target.c')
0 files changed, 0 insertions, 0 deletions