Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter
Дата
Msg-id 10777.1332439022@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter  (aburacze@gmail.com)
Ответы Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter  (Adam Buraczewski <aburacze@gmail.com>)
Список pgsql-bugs
aburacze@gmail.com writes:
> I have just found strange behaviour of PL/pgSQL in case of using OUT
> parameters and GET DIAGNOSTICS var = ROW_COUNT (PostgreSQL 9.1.3). Here is a
> self-contained example:

Wow, that's been broken since the beginning, apparently.  There's an
entirely bogus test in exec_stmt_getdiag():

        if (diag_item->target <= 0)
            continue;

It's not clear what the point of this is, since there is no case in
which the target variable should be invalid, but in any case the effect
is to ignore attempts to assign to any variable with dno zero --- which
will be the one first defined in the function, eg the first parameter
if any.  I guess I can see how this escaped detection for a long time,
but it's broken for sure.  Thanks for the report!

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter
Следующее
От: Adam Buraczewski
Дата:
Сообщение: Re: BUG #6551: PL/pgSQL: GET DIAGNOSTICS not working for first OUT parameter