Back-patch fix and test case for bug #7516.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Sep 2012 15:50:19 +0000 (11:50 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Sep 2012 15:50:19 +0000 (11:50 -0400)
commit2734af4ea92c3e2ac19dc9365d5218571c080803
tree379db7449c80e68a214f3c399844023249043976
parent4da51c25a505b09b2e312953da97502111a8c69e
Back-patch fix and test case for bug #7516.

Back-patch commits 9afc6481117d2dd936e752da0424a2b6b05f6459 and
b8fbbcf37f22c5e8361da939ad0fc4be18a34ca9.  The first of these is really
a minor code cleanup to save a few cycles, but it turns out to provide
a workaround for the misoptimization problem described in bug #7516.
The second commit adds a regression test case.

Back-patch the fix to all active branches.  The test case only works
as far back as 9.0, because it relies on plpgsql which isn't installed
by default before that.  (I didn't have success modifying it into an
all-plperl form that still provoked a crash, though this may just reflect
my lack of Perl-fu.)
src/pl/plperl/plperl.c