Bug #749: one NULL function parameter makes all other NULL

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #749: one NULL function parameter makes all other NULL
Date: 2002-08-27 14:42:03
Message-ID: 20020827144203.EE0F5475D95@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Laurent HERVE (laurent-herve(at)club-internet(dot)fr) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
one NULL function parameter makes all other NULL

Long Description
I don't know if this is really a bug but it seems like for me and it is very annoying. I checked all release notes of recent releases to find some king of bug fix for that, without sucess.
I know, my postgresql version is a little bit old, but I cannot upgrade know.
But I just want to know if that bug is known and corrected in recent release.
So here it is :

test=# create function foo(date,char(10))
test-# returns integer
test-# as '
test-# declare
test-# p1 alias for $1;
test-# p2 alias for $2;
test-# begin
test-# raise notice ''% %'',p1,p2;
test-# return (''1'');
test-# end;'
test-# language 'plpgsql';
test-#
CREATE

test=# select foo('2002-05-02','236');
NOTICE: 2002-05-02 236
foo
-----
1
(1 row)

test=# select foo('2002-05-02',NULL);
NOTICE: <NULL> <NULL>
foo
-----
1
(1 row)

So why the first parameter became NULL ?

test=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.96
(1 row)

Sample Code

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruno Wolff III 2002-08-27 14:58:19 cube bug accepting -.1
Previous Message Bruce Momjian 2002-08-27 14:20:08 Re: Bug #748: Temp tables don't work in functions