Re: Improve performance of pg_strtointNN functions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Improve performance of pg_strtointNN functions
Дата
Msg-id CAApHDvq_=adeFd+iga05=VZCw4vgN35+kLS-WLJ9vGDCc1cObw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Improve performance of pg_strtointNN functions  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
On Sun, 4 Dec 2022 at 22:53, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> Ah, I see that you changed the overflow test, and I realise that I
> forgot to answer your question about why I wrote that as 1 - INT_MIN /
> 10 over on the other thread.
>
> The reason is that we need to detect whether tmp * base will exceed
> -INT_MIN, not INT_MAX, since we're accumulating the absolute value of
> a signed integer.

I think I'd been too focused on the simplicity of that expression and
also the base 10 part. I saw that everything worked in base 10 and
failed to give enough forward thought to other bases.

I now see that it was wrong-headed to code it the way I had it.
Thanks for pointing this out. I've just pushed a fix.

David



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

Предыдущее
От: Maciek Sakrejda
Дата:
Сообщение: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Следующее
От: Noah Misch
Дата:
Сообщение: Re: restoring user id and SecContext before logging error in ri_PlanCheck