Fix inappropriate uses of PG_GETARG_UINT32()

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Fix inappropriate uses of PG_GETARG_UINT32()
Дата
Msg-id 7e43869b-d412-8f81-30a3-809783edc9a3@enterprisedb.com
обсуждение исходный текст
Ответы Re: Fix inappropriate uses of PG_GETARG_UINT32()  ("Bossart, Nathan" <bossartn@amazon.com>)
Список pgsql-hackers
I noticed that the chr() function uses PG_GETARG_UINT32() to get its 
argument, even though the argument is a (signed) int.  So you get some 
slightly silly behavior like this:

=> select chr(-333);
ERROR:  54000: requested character too large for encoding: -333

The attached patch fixes this by accepting the argument using 
PG_GETARG_INT32(), doing some checks, and then casting it to unsigned 
for the rest of the code.

The patch also fixes another inappropriate use in an example in the 
documentation.  These two were the only inappropriate uses I found, 
after we had fixed a few recently.
Вложения

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

Предыдущее
От: Kenaniah Cerny
Дата:
Сообщение: Re: Proposal: allow database-specific role memberships
Следующее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file