pgsql: Fix miscalculation of itemsafter in array_set_slice().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix miscalculation of itemsafter in array_set_slice().
Дата
Msg-id E1PetaB-0005X8-6T@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix miscalculation of itemsafter in array_set_slice().

If the slice to be assigned to was before the existing array lower bound
(requiring at least one null element to spring into existence to fill the
gap), the code miscalculated how many entries needed to be copied from
the old array's null bitmap.  This could result in trashing the array's
data area (as seen in bug #5840 from Karsten Loesing), or worse.

This has been broken since we first allowed the behavior of assigning to
non-adjacent slices, in 8.2.  Back-patch to all affected versions.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=bdd8ed973da9ab48aba2292b01f71d2f9968b82c

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c |    6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix miscalculation of itemsafter in array_set_slice().
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Use HTABs instead of Python dictionary objects to cache procedur