call plpgsql function bug! (set arguments to NULL) - Mailing list pgsql-bugs

From Dmitry Gercog
Subject call plpgsql function bug! (set arguments to NULL)
Date
Msg-id 3A1F7DFF.4D7F8BF@pptus.oilnet.ru
Whole thread Raw
List pgsql-bugs
Hi!

I'm found that call function has bug:
some function have more than one arguments and
if one argument is NULL, then all other arguments
is NULL too! But function calling only with one
NULL arguments. Why?!

My system Linux Slackware 7.0, Postgres 7.0.2.
kernel 2.2.16


log file attached.

Dmitry Gercog.mybase=# select version();
                                 version
--------------------------------------------------------------------------
 PostgreSQL 7.0.2 on i686-pc-linux-gnulibc1, compiled by gcc egcs-2.91.66
(1 row)

mybase=# CREATE FUNCTION tst_func(int4, int4) RETURNS INT4 AS '
mybase'#   DECLARE
mybase'#   BEGIN
mybase'#     RAISE NOTICE ''{%, %}'', $1, $2;
mybase'#     RETURN $1 + $2;
mybase'#   END;
mybase'# ' LANGUAGE 'plpgsql';
CREATE
mybase=# select tst_func(1,2);
NOTICE:  {1, 2}
 tst_func
----------
        3
(1 row)

mybase=# select tst_func(1,NULL);
NOTICE:  {<NULL>, <NULL>}
 tst_func
----------

(1 row)

mybase=#

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fails to add function from file with \i in psql
Next
From: "Dino Dini"
Date:
Subject: case / coalesce problem with strings