plperl function has side-effects

From: Joachim Wieland <joe(at)mcknight(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: plperl function has side-effects
Date: 2005-03-03 16:41:36
Message-ID: 20050303164136.GA8419@mcknight.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have a 7.4.3 installation where a small plperl function seems to have
side-effects. In the example below I run an ordinary SELECT first, nothing
special with the table. Thereafter I call the plperl function and then I
rerun the SELECT query. This time it doesn't return the expected result. The
problem seems to show up only after postgres has run for quite a while.
Futhermore this effect is limited to the current session. I'll upgrade the
machine to 7.4.7 during the weekend, however I haven't seen anything in the
release notes that seems to matter, does anybody know this effect or is this
issue even already solved?

(Crypt::PasswdMD5 1.3, perl 5.8.4)

db=> select login from subaccounts where login='web1p1';
login
--------
web1p1
(1 row)

db=> select md5password('bla1', 'Ao2ZaGKp');
md5password
------------------------------------
$1$Ao2ZaGKp$XBDNeuZM3RSrqq9gruKXH1
(1 row)

db=> select login from subaccounts where login='web1p1';
login
-------
(0 rows)

The definition of md5password:

CREATE FUNCTION md5password(varchar(20), varchar(50)) RETURNS varchar(50)
SECURITY DEFINER AS '
use Crypt::PasswdMD5;

my $password = $_[0];
my $salt = $_[1];

my $crypted = unix_md5_crypt($password, $salt);

return $crypted;
' LANGUAGE 'plperlu';

Thanks,
Joachim

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-03 16:56:32 Re: 8.0.X and the ARC patent
Previous Message pgsql 2005-03-03 16:41:20 Re: bitmap AM design