Re: another plperl bug

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: another plperl bug
Date: 2004-11-22 21:17:05
Message-ID: 20041122211705.GA82149@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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 | 2
3 | 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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin M. Roy 2004-11-22 21:28:48 Re: Beta5 now Available
Previous Message Simon Riggs 2004-11-22 20:52:31 Re: [Testperf-general] Re: ExclusiveLock

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-11-22 21:23:37 Re: htmlhelp generation
Previous Message Tom Lane 2004-11-22 20:38:26 Re: another plperl bug