Termination When Switching between PL/Perl and PL/PerlU

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Termination When Switching between PL/Perl and PL/PerlU
Date: 2010-01-13 19:08:33
Message-ID: 3B7D73DA-89EB-4F3D-98C8-2338D8245EF7@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Found in 8.4.2, replicated in HEAD. Steps:

1. Create PL/Perl function.
2. Run it.
3. Create same function with PL/PerlU
4. Run it.
5. Create same function again with PL/Perl
6. Boom.

Example on HEAD built today (ignore the error from the plperl version, that's the issue I'm trying to fix locally):

postgres=# create or replace function wtf(text) returns text language plperl as 'shift';
CREATE FUNCTION
Time: 151.054 ms
postgres=# select wtf('hey');
ERROR: invalid byte sequence for encoding "UTF8": 0x00
CONTEXT: PL/Perl function "wtf"
postgres=# create or replace function wtf(text) returns text language plperlu as 'shift';
CREATE FUNCTION
Time: 41.255 ms
postgres=# select wtf('hey');
wtf
-----
hey
(1 row)

Time: 0.523 ms
postgres=# create or replace function wtf(text) returns text language plperl as 'shift';
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vincenzo Romano 2010-01-13 19:10:53 BUG #5274: [PL/PgSQL] EXECUTE ... USING variable expansion
Previous Message Kevin Grittner 2010-01-13 17:21:00 Re: Substring auto trim