[COMMITTERS] pgsql: Fix handling of empty arrays in array_fill().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Fix handling of empty arrays in array_fill().
Дата
Msg-id E1cPAzT-0002Mc-R3@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix handling of empty arrays in array_fill().

array_fill(..., array[0]) produced an empty array, which is probably
what users expect, but it was a one-dimensional zero-length array
which is not our standard representation of empty arrays.  Also, for
no very good reason, it rejected empty input arrays; that case should
be allowed and produce an empty output array.

In passing, remove the restriction that the input array(s) have lower
bound 1.  That seems rather pointless, and it would have needed extra
complexity to make the check deal with empty input arrays.

Per bug #14487 from Andrew Gierth.  It's been broken all along, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/20170105152156.10135.64195@wrigleys.postgresql.org

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ee9cb284a6d6c79080033b825391b8b78b5eccfb

Modified Files
--------------
src/backend/utils/adt/arrayfuncs.c   | 26 +++++++-------------------
src/test/regress/expected/arrays.out | 27 +++++++++++++++++++++++++++
src/test/regress/sql/arrays.sql      |  8 ++++++++
3 files changed, 42 insertions(+), 19 deletions(-)


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: [COMMITTERS] pgsql: Fix format for TAP test docs
Следующее
От: Robert Haas
Дата:
Сообщение: [COMMITTERS] pgsql: Fix possible crash reading pg_stat_activity.