Age | Commit message (Collapse) | Author |
|
|
|
lookup of the well-known OID of textout().
|
|
implicit loading of modules, thereby breaking Safe rules.
We compile and call a tiny perl function on trusted interpreter init, after which
the problem does not occur.
|
|
The correct test for defined-ness is SvOK(sv), not anything involving
SvTYPE. Per bug #3415 from Matt Taylor.
Back-patch as far as 8.0; no apparent problem in 7.x.
|
|
|
|
on an attempt to create the second interpreter if this is not supported by
the perl installation. Per recent -hackers discussion.
|
|
from Magnus that MSVC complains about this.
|
|
are marked as UTF8 when the database encoding is UTF8. This should
avoid inconsistencies like that exhibited in bug #2683 from Vitali Stupin.
|
|
|
|
Fix all the standard PLs to be able to return tuples from FOO_RETURNING
statements as well as utility statements that return tuples. Also,
fix oversight that SPI_processed wasn't set for a utility statement
returning tuples. Per recent discussion.
|
|
|
|
hash and array variables. (regression output updated)
|
|
hashes. Was causing regression failures.
|
|
Allow conversion from perl to postgresql array in OUT parameters. Second,
allow hash form output from procedures with one OUT argument.
Pavel Stehule
|
|
loaded libraries: call functions _PG_init() and _PG_fini() if the library
defines such symbols. Hence we no longer need to specify an initialization
function in preload_libraries: we can assume that the library used the
_PG_init() convention, instead. This removes one source of pilot error
in use of preloaded libraries. Original patch by Ralf Engelschall,
preload_libraries changes by me.
|
|
by creating a reference-count mechanism, similar to what we did a long time
ago for catcache entries. The back branches have an ugly solution involving
lots of extra copies, but this way is more efficient. Reference counting is
only applied to tupdescs that are actually in caches --- there seems no need
to use it for tupdescs that are generated in the executor, since they'll go
away during plan shutdown by virtue of being in the per-query memory context.
Neil Conway and Tom Lane
|
|
in every shared library.
|
|
with a fresh local value for each invocation, to avoid unexpected sharing
violations. Per recent -hackers discussion.
|
|
kept but now deprecated. Patch from Adam Sjøgren. Add regression test to
show plperl trigger data (Andrew).
TBD: apply similar changes to plpgsql, plpython and pltcl.
|
|
functions are not strict, they will be called (passing a NULL first parameter)
during any attempt to input a NULL value of their datatype. Currently, all
our input functions are strict and so this commit does not change any
behavior. However, this will make it possible to build domain input functions
that centralize checking of domain constraints, thereby closing numerous holes
in our domain support, as per previous discussion.
While at it, I took the opportunity to introduce convenience functions
InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O
functions. This eliminates a lot of grotty-looking casts, but the main
motivation is to make it easier to grep for these places if we ever need
to touch them again.
|
|
non-NULL: palloc() ereports on OOM, so we can safely assume it returns a
valid pointer.
|
|
during parse analysis, not only errors detected in the flex/bison stages.
This is per my earlier proposal. This commit includes all the basic
infrastructure, but locations are only tracked and reported for errors
involving column references, function calls, and operators. More could
be done later but this seems like a good set to start with. I've also
moved the ReportSyntaxErrorPosition logic out of psql and into libpq,
which should make it available to more people --- even within psql this
is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
|
|
derived from Jan's.
|
|
and docs from Dmitry Karasik, slightly editorialised.
|
|
|
|
|
|
elsewhere by setting the environment appropriately, we make perl do it
right after interpreter startup by calling its POSIX::setlocale().
|
|
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.
|
|
declares routines in plperl.c and spi_internal.c used in other files.
Along the way, also stop perl from hijacking stdio and other stuff on Windows.
|
|
haven't had a chance to mangle the definition of DLLIMPORT (thanks again, perl guys).
|
|
we want it to check the argument/result data types and no more. In
particular, libperl shouldn't get initialized in this case.
|
|
comment line where output as too long, and update typedefs for /lib
directory. Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).
Backpatch to 8.1.X.
|
|
arrays. Update plperl regression test accordingly.
|
|
avoid leaking memory. I would add a regression test for error handling
except it seems eval{} can't be used in unprivileged plperl :-(
|
|
|
|
|
|
fly. Fix problem with incompletely duplicated setup code. Andrew Dunstan,
from an idea of Michael Fuhr's.
|
|
idea on consistency grounds, whether or not it really fixes bug #1831.
Michael Fuhr
|
|
|
|
|
|
> position. Performing the check in the existing position allows the call
> to go through to perl first, possibly resulting in a SEGV.
Andrew Dunstan
|
|
Reported by Michael Fuhr, fixed by Andrew Dunstan.
|
|
Add suitable regression tests. Andrew Dunstan
|
|
Add missing plperl include.
|
|
return arays nicely without having to make the plperl programmer aware
of anything. The attached patch allows plperl to return an arrayref
where the function returns an array type. It silently calls a perl
function to stringify the array before passing it to the pg array
parser. Non-array returns are handled as before (i.e. passed through
this process) so it is backwards compatible. I will presently submit
regression tests and docs.
example:
andrew=# create or replace function blah() returns text[][] language
plperl as $$ return [['a"b','c,d'],['e\\f','g']]; $$;
CREATE FUNCTION
andrew=# select blah();
blah
-----------------------------
{{"a\"b","c,d"},{"e\\f",g}}
This would complete half of the TODO item:
. Pass arrays natively instead of as text between plperl and postgres
(The other half is translating pg array arguments to perl arrays - that
will have to wait for 8.1).
Some of this patch is adapted from a previously submitted patch from
Sergej Sergeev. Both he and Abhijit Menon-Sen have looked it over
briefly and tentatively said it looks ok.
Andrew Dunstan
|
|
for PL/Perl, to avoid loading the entire result set into memory as the
existing spi_exec_query() function does.
Here's how one might use the new functions:
$x = spi_query("select ...");
while (defined ($y = spi_fetchrow($x))) {
...
return_next(...);
}
The changes do not affect the spi_exec_query() interface in any way.
Abhijit Menon-Sen
|
|
plperl - the attached small patch remedies that omission, and adds a
small regression test for error and warning output - the new regression
input and expected output are in separate attached files.
Andrew Dunstan
|
|
plperl - the attached small patch remedies that omission.
Andrew Dunstan
|
|
|
|
|