Re: BUG #16953: OOB access while converting "interval" to char

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #16953: OOB access while converting "interval" to char
Дата
Msg-id YG7YTjuZXylrjGAv@paquier.xyz
обсуждение исходный текст
Ответ на Re: BUG #16953: OOB access while converting "interval" to char  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: BUG #16953: OOB access while converting "interval" to char  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-bugs
On Wed, Apr 07, 2021 at 08:08:56PM +0800, Julien Rouhaud wrote:
> PFA a naive patch to fix this problem with some regression tests.  I'm assuming
> that -1 month should be january and not december.  I had a quick look at the
> rest of formatting.c and didn't spot any similar problem, but another pair of
> eyes wouldn't hurt.

Assuming an absolute number is not really intuitive when it comes to a
negative number here, while counting backward feels more natural, so I
would vote for making -1 be December, -2 November, etc.

Let's also make the tests more extended.  I would suggest a single
query with generate_series() from say -12 to 12, that checks the
output of both RM and rm for the full range of values supported by
tm_mon.
--
Michael

Вложения

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

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: XX000: iso-8859-1 type of jsonb container.
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: BUG #16953: OOB access while converting "interval" to char