postgresql/src
Tom Lane 9bf4068cc3 Fix datumSerialize infrastructure to not crash on non-varlena data.
Commit 1efc7e538 did a poor job of emulating existing logic for touching
Datums that might be expanded-object pointers.  It didn't check for typlen
being -1 first, which meant it could crash on fixed-length pass-by-ref
values, and probably on cstring values as well.  It also didn't use
DatumGetPointer before VARATT_IS_EXTERNAL_EXPANDED, which while currently
harmless is not according to documentation nor prevailing style.

I also think the lack of any explanation as to why datumSerialize makes
these particular nonobvious choices is pretty awful, so fix that.

Per report from Jarred Ward.  Back-patch to 9.6 where this code came in.

Discussion: https://postgr.es/m/6F61E6D2-2F5E-4794-9479-A429BE1CEA4B@simple.com
2017-08-08 19:18:22 -04:00
..
backend Fix datumSerialize infrastructure to not crash on non-varlena data. 2017-08-08 19:18:22 -04:00
bin Translation updates 2017-08-07 13:55:34 -04:00
common Update copyright in recently added files 2017-07-26 18:17:18 -04:00
fe_utils Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
include Fix replication origin-related race conditions 2017-08-08 16:07:46 -04:00
interfaces Translation updates 2017-08-07 13:55:34 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl Translation updates 2017-08-07 13:55:34 -04:00
port Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
template
test Fix yet another race condition in recovery/t/001_stream_rep.pl. 2017-08-08 18:03:30 -04:00
timezone Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
tools Update RELEASE_CHANGES' example of branch name format. 2017-08-06 23:26:09 -04:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore
DEVELOPERS
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in PL/Perl portability fix: absorb relevant -D switches from Perl. 2017-07-28 14:25:28 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk