pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: andrew@tao11.riddles.org.uk
To: pgsql-bugs@postgresql.org
Subject: BUG #14487: malformed empty array from array_fill
Date: Thu, 05 Jan 2017 15:21:56 +0000
Message-ID: <20170105152156.10135.64195@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


view thread (3+ messages)  latest in thread

Message-ID: <20170105152156.10135.64195@wrigleys.postgresql.org>
Permalink:  ../20170105152156.10135.64195@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170105152156.10135.64195@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk
  Subject: Re: BUG #14487: malformed empty array from array_fill
  In-Reply-To: <20170105152156.10135.64195@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox