postgresql/src
Neil Conway 81dbda0792 Per a bug report from Theo Schlossnagle, plperl_return_next() leaks
memory in the executor's per-query memory context. It also inefficient:
it invokes get_call_result_type() and TupleDescGetAttInMetadata() for
every call to return_next, rather than invoking them once (per PL/Perl
function call) and memoizing the result.

This patch makes the following changes:

- refactor the code to include all the "per PL/Perl function call" data
inside a single struct, "current_call_data". This means we don't need to
save and restore N pointers for every recursive call into PL/Perl, we
can just save and restore one.

- lookup the return type metadata needed by plperl_return_next() once,
and then stash it in "current_call_data", so as to avoid doing the
lookup for every call to return_next.

- create a temporary memory context in which to evaluate the return
type's input functions. This memory context is reset for each call to
return_next.

The patch appears to fix the memory leak, and substantially reduces
the overhead imposed by return_next.
2006-01-28 03:28:19 +00:00
..
backend Fix display of whole-row Var appearing at the top level of a SELECT list. 2006-01-26 17:08:26 +00:00
bin Fix pg_ctl crash on "unregister" when a data directory is not specified. 2006-01-14 16:16:08 +00:00
include It turns out that TablespaceCreateDbspace fails badly if a relcache flush 2006-01-19 04:45:47 +00:00
interfaces Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundant 2006-01-25 20:44:49 +00:00
makefiles Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path for AIX and Darwin. 2006-01-19 21:19:15 +00:00
pl Per a bug report from Theo Schlossnagle, plperl_return_next() leaks 2006-01-28 03:28:19 +00:00
port Stamp release 8.1.2. 2006-01-05 04:02:26 +00:00
template SUNOS4_CC -> SUNOS_CC. 2005-07-30 03:07:42 +00:00
test Improve error messages for missing-FROM-entry cases, as per recent discussion. 2006-01-10 22:00:07 +00:00
timezone Re-run pgindent, fixing a problem where comment lines after a blank 2005-11-22 18:23:31 +00:00
tools Properly document return value of strpos(). 2005-11-16 03:56:35 +00:00
tutorial Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
utils PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with 2004-07-30 12:26:40 +00:00
bcc32.mak Add -N make flag to bcc builds from /src dir. 2005-05-13 18:12:35 +00:00
DEVELOPERS
Makefile Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
Makefile.global.in Fix problems with PGXS builds against an installation tree that was 2005-09-27 17:39:35 +00:00
Makefile.shlib Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX. 2005-12-03 20:16:39 +00:00
nls-global.mk More locale fixes for pg_ctl. 2004-06-01 03:32:42 +00:00
win32.mak Attached is a makefile I hacked up to build pg_config under MSVC - the 2005-06-14 17:50:38 +00:00