Re: BUG #6139: LIMIT doesn't return correct result when the value is huge

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #6139: LIMIT doesn't return correct result when the value is huge
Дата
Msg-id 4E37ABF1.5080609@enterprisedb.com
обсуждение исходный текст
Ответ на BUG #6139: LIMIT doesn't return correct result when the value is huge  ("Hitoshi Harada" <umi.tanuki@gmail.com>)
Список pgsql-bugs
On 02.08.2011 09:25, Hitoshi Harada wrote:
> db1=# select count(*) from test_xy;
>   count
> -------
>      31
> (1 row)
>
> db1=# select * from test_xy order by x LIMIT 9223372036854775807 OFFSET 6;
>   gid |         x          |         y
> -----+--------------------+--------------------
>    13 | -0.591943957968476 | -0.481611208406305
> (1 row)

The bug seems to occur when LIMIT + OFFSET >= 2^63. In ExecLimit
function, we check if current position >= offset + limit, and that
overflows.

I'll commit the attached patch to fix that. Thanks for the report

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: BUG #6139: LIMIT doesn't return correct result when the value is huge
Следующее
От: "Steve Boyd"
Дата:
Сообщение: BUG #6140: PostgreSQL Server Service Not Starting