Re: another plperl bug - Mailing list pgsql-hackers

From Michael Fuhr
Subject Re: another plperl bug
Date
Msg-id 20041122211705.GA82149@winnie.fuhr.org
Whole thread Raw
In response to Re: another plperl bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: another plperl bug
Re: another plperl bug
List pgsql-hackers
On Mon, Nov 22, 2004 at 03:34:17PM -0500, Tom Lane wrote:
> 
> Thanks for the examples.  I extended this into a simple regression test
> which I've added to CVS.  If anyone would like to add some test cases
> for more interesting stuff (triggers and error handling come to mind),
> step right up ...

Here's another test case: a function that doesn't return what it's
supposed to return.

CREATE TYPE footype AS (x INTEGER, y INTEGER);

CREATE FUNCTION foo_good() RETURNS SETOF footype AS $$
return [   {x => 1, y => 2},   {x => 3, y => 4}
];
$$ LANGUAGE plperl;

SELECT * FROM foo_good();x | y 
---+---1 | 23 | 4
(2 rows)

CREATE FUNCTION foo_bad() RETURNS SETOF footype AS $$
return [   [1, 2],   [3, 4]
];
$$ LANGUAGE plperl;

SELECT * FROM foo_bad();
server closed the connection unexpectedly

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [Testperf-general] Re: ExclusiveLock
Next
From: "Gavin M. Roy"
Date:
Subject: Re: Beta5 now Available