bug in PLPGSQL

From: Andriy I Pilipenko <bamby(at)marka(dot)net(dot)ua>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug in PLPGSQL
Date: 2001-03-28 09:56:13
Message-ID: Pine.BSF.4.21.0103281253040.89943-100000@bamby.marka.net.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Your name : Andriy I Pilipenko
Your email address : bamby(at)marka(dot)net(dot)ua

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium

Operating System (example: Linux 2.0.26 ELF) : FreeBSD-4.2-STABLE

PostgreSQL version (example: PostgreSQL-7.0): PostgreSQL-7.0.3

Compiler used (example: gcc 2.8.0) : gcc version 2.95.2 19991024 (release)

Please enter a FULL description of your problem:
------------------------------------------------

There is bug in PLPGSQL. If one of the parameters to plpgsql function is
null, other parameters becomes null too.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

First create function like this:

CREATE FUNCTION f(varchar, varchar) RETURNS varchar
AS '
begin
return ''first arg is: '' || $1;
end;
' LANGUAGE 'plpgsql';

Then run query "SELECT f('some text', NULL)" and you will receive null
value.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Browse pgsql-bugs by date

  From Date Subject
Next Message Salvador Mainé 2001-03-28 10:50:46 date_part bug
Previous Message Marcin Kowalski 2001-03-28 07:37:21 Re: pg_dump potential bug