[BUGS] BUG #14487: malformed empty array from array_fill

Поиск
Список
Период
Сортировка
От andrew@tao11.riddles.org.uk
Тема [BUGS] BUG #14487: malformed empty array from array_fill
Дата
Msg-id 20170105152156.10135.64195@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: [BUGS] BUG #14487: malformed empty array from array_fill  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14487
Logged by:          Andrew Gierth
Email address:      andrew@tao11.riddles.org.uk
PostgreSQL version: 9.6.1
Operating system:   any
Description:

array_fill returns a malformed empty array when given a size of zero:

select a, a = '{}' from (select array_fill(null::integer, array[0]) as a)
s;
 a  | ?column? 
----+----------
 {} | f

The result actually has ndims=1 and a length of 0, which can be checked with
array_length(a,1).

Obvious fix is to move the fast-track empty result to after computing
nitems?


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [BUGS] [BUG] pg9.4.10 Logical decoding did not get the correctoldtuplelen
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: [BUGS] BUG #14487: malformed empty array from array_fill