pgsql: Fix a bug in pairing heap removal code.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix a bug in pairing heap removal code.
Дата
Msg-id E1YNpFu-00013u-Gv@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix a bug in pairing heap removal code.

After removal, the next_sibling pointer of a node was sometimes incorrectly
left to point to another node in the heap, which meant that a node was
sometimes linked twice into the heap. Surprisingly that didn't cause any
crashes in my testing, but it was clearly wrong and could easily segfault
in other scenarios.

Also always keep the prev_or_parent pointer as NULL on the root node. That
was not a correctness issue AFAICS, but let's be tidy.

Add a debugging function, to dump the contents of a pairing heap as a
string. It's #ifdef'd out, as it's not used for anything in any normal
code, but it was highly useful in debugging this. Let's keep it handy for
further reference.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/931bf3eb9b203ca02d729f5122a44cc250c27695

Modified Files
--------------
src/backend/lib/pairingheap.c |   59 +++++++++++++++++++++++++++++++++++++++++
src/include/lib/pairingheap.h |   11 ++++++++
2 files changed, 70 insertions(+)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix knn-GiST queue comparison function to return heap tuples fir
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix EXPLAIN output for cases where parent table is excluded by c