call plpgsql function bug! (set arguments to NULL)

Поиск
Список
Период
Сортировка
От Dmitry Gercog
Тема call plpgsql function bug! (set arguments to NULL)
Дата
Msg-id 3A1F7DFF.4D7F8BF@pptus.oilnet.ru
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Fails to add function from file with \i in psql
Следующее
От: "Dino Dini"
Дата:
Сообщение: case / coalesce problem with strings