Re: BUG #8410: out of binary heap slots
От | Andres Freund |
---|---|
Тема | Re: BUG #8410: out of binary heap slots |
Дата | |
Msg-id | 20130830212707.GC8932@awork2.anarazel.de обсуждение исходный текст |
Ответ на | Re: BUG #8410: out of binary heap slots (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Список | pgsql-bugs |
On 2013-08-30 17:15:32 -0400, Alvaro Herrera wrote: > Andres Freund wrote: > > > No need, found the bug. And I think can build a testcase myself. > > > > ExecReScanMergeAppend resets ms_initialized, but doesn't clear the > > binaryheap. Thus no new elements fit. > > Um. Are we missing a binaryheap_clear() method? In the patch I am patch-to-be it's binaryheap_reset(), but yes ;). Are you already patching it, or do you want me to finish it? I have a not so nice testcase and I can confirm that this is the issue and that a binaryheap_reset() fixes it: SELECT (SELECT g.i FROM ((SELECT random()::int ORDER BY 1 OFFSET 0) UNION ALL (SELECT random()::int ORDER BY 1 OFFSET 0))f(i) ORDER BY f.i LIMIT 1) FROM generate_series(1, 10) g(i); Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-bugs по дате отправления: