Re: pgsql: Fix pg_size_pretty() to avoid overflow for inputs close to INT64

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Fix pg_size_pretty() to avoid overflow for inputs close to INT64
Дата
Msg-id 2846.1304021138@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Fix pg_size_pretty() to avoid overflow for inputs close to INT64  (Dave Page <dpage@postgresql.org>)
Список pgsql-committers
Dave Page <dpage@postgresql.org> writes:
> On Thu, Apr 28, 2011 at 8:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I was suspicious that it had something to do with the compiler trying to
>> optimize the size / mult and size % mult subexpressions

> Already did (that was my first assumption). Removing them doesn't
> help, nor does rewriting them in various strange ways. Removing val++;
> (and replacing with { } ) allows compilation to succeed.

Huh.  Well, it might still be the case that switching to a shift-based
implementation would work around it, since we could avoid having any ++
operation in that.  Let me give it a shot.

            regards, tom lane

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