postgresql/src
Tom Lane 13671b4b22 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>
2016-11-19 14:26:19 -05:00
..
backend Code review for GUC serialization/deserialization code. 2016-11-19 14:26:19 -05:00
bin Clean up pg_dump tests, re-enable BLOB testing 2016-11-18 14:21:33 -05:00
common Rename "pg_xlog" directory to "pg_wal". 2016-10-20 11:32:18 -04:00
fe_utils Teach appendShellString() to not quote strings containing "-". 2016-09-06 14:53:31 -04:00
include Add pg_sequences view 2016-11-18 14:59:03 -05:00
interfaces Allow DOS-style line endings in ~/.pgpass files. 2016-11-15 16:17:19 -05:00
makefiles Provide NO_INSTALLCHECK option for pgxs. 2016-11-14 14:53:07 -08:00
pl Check that result tupdesc has exactly 1 column in return_next scalar case. 2016-11-15 16:48:19 -05:00
port pgwin32_is_junction's argument should be "const char *" not "char *". 2016-11-05 11:14:10 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Add pg_sequences view 2016-11-18 14:59:03 -05:00
timezone More zic cleanup. 2016-11-06 10:45:58 -05:00
tools Change qr/foo$/m to qr/foo\n/m, for Perl 5.8.8. 2016-11-07 20:27:30 -05:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Allow individual TAP tests to be run via PROVE_TESTS 2016-11-14 10:00:41 -05:00
Makefile.shlib Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -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