pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8395: empty aclitem arrays are considered 1-dimensional
3+ messages / 3 participants
[nested] [flat]

* BUG #8395: empty aclitem arrays are considered 1-dimensional
@ 2013-08-23 16:17 bashtanov@imap.cc
  2014-01-31 23:37 ` Re: BUG #8395: empty aclitem arrays are considered 1-dimensional Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 3+ messages in thread

From: bashtanov@imap.cc @ 2013-08-23 16:17 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      8395
Logged by:          Alexey Bashtanov
Email address:      bashtanov@imap.cc
PostgreSQL version: 9.1.9
Operating system:   Ubuntu linux 12.04
Description:        

Empty aclitem arrays are considered 1-dimensional, but in general empty
arrays are 0-dimensional. It leads to the following problems:


STEPS TO REPRODUCE
1) install fresh postgres, connect to it
2) select relacl, relacl = '{}'::aclitem[], (select aclexplode(relacl)),
array_length(relacl, 1) from pg_class where oid::regclass =
'pg_largeobject'::regclass;
3) select aclexplode('{}'::aclitem[]);


EXPECTED
2) {}, false, null, null
3) no error, zero-lines table


GOT
2)  relacl | ?column? | ?column? | array_length 
--------+----------+----------+--------------
 {}     | f        |          |            0
3) ERROR:  ACL arrays must be one-dimensional


also it can be reproduced on some 9.2 version






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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #8395: empty aclitem arrays are considered 1-dimensional
  2013-08-23 16:17 BUG #8395: empty aclitem arrays are considered 1-dimensional bashtanov@imap.cc
@ 2014-01-31 23:37 ` Bruce Momjian <bruce@momjian.us>
  2014-02-05 14:29   ` Re: BUG #8395: empty aclitem arrays are considered 1-dimensional Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2014-01-31 23:37 UTC (permalink / raw)
  To: bashtanov@imap.cc; +Cc: pgsql-bugs

On Fri, Aug 23, 2013 at 04:17:55PM +0000, bashtanov@imap.cc wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      8395
> Logged by:          Alexey Bashtanov
> Email address:      bashtanov@imap.cc
> PostgreSQL version: 9.1.9
> Operating system:   Ubuntu linux 12.04
> Description:        
> 
> Empty aclitem arrays are considered 1-dimensional, but in general empty
> arrays are 0-dimensional. It leads to the following problems:
> 
> 
> STEPS TO REPRODUCE
> 1) install fresh postgres, connect to it
> 2) select relacl, relacl = '{}'::aclitem[], (select aclexplode(relacl)),
> array_length(relacl, 1) from pg_class where oid::regclass =
> 'pg_largeobject'::regclass;
> 3) select aclexplode('{}'::aclitem[]);
> 
> 
> EXPECTED
> 2) {}, false, null, null
> 3) no error, zero-lines table
> 
> 
> GOT
> 2)  relacl | ?column? | ?column? | array_length 
> --------+----------+----------+--------------
>  {}     | f        |          |            0
> 3) ERROR:  ACL arrays must be one-dimensional
> 
> 
> also it can be reproduced on some 9.2 version

Can someone comment on this bug report?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #8395: empty aclitem arrays are considered 1-dimensional
  2013-08-23 16:17 BUG #8395: empty aclitem arrays are considered 1-dimensional bashtanov@imap.cc
  2014-01-31 23:37 ` Re: BUG #8395: empty aclitem arrays are considered 1-dimensional Bruce Momjian <bruce@momjian.us>
@ 2014-02-05 14:29   ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Robert Haas @ 2014-02-05 14:29 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Alexey Bashtanov <bashtanov@imap.cc>; pgsql-bugs

On Fri, Jan 31, 2014 at 6:37 PM, Bruce Momjian <bruce@momjian.us> wrote:
> On Fri, Aug 23, 2013 at 04:17:55PM +0000, bashtanov@imap.cc wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      8395
>> Logged by:          Alexey Bashtanov
>> Email address:      bashtanov@imap.cc
>> PostgreSQL version: 9.1.9
>> Operating system:   Ubuntu linux 12.04
>> Description:
>>
>> Empty aclitem arrays are considered 1-dimensional, but in general empty
>> arrays are 0-dimensional. It leads to the following problems:
>>
>>
>> STEPS TO REPRODUCE
>> 1) install fresh postgres, connect to it
>> 2) select relacl, relacl = '{}'::aclitem[], (select aclexplode(relacl)),
>> array_length(relacl, 1) from pg_class where oid::regclass =
>> 'pg_largeobject'::regclass;
>> 3) select aclexplode('{}'::aclitem[]);
>>
>>
>> EXPECTED
>> 2) {}, false, null, null
>> 3) no error, zero-lines table
>>
>>
>> GOT
>> 2)  relacl | ?column? | ?column? | array_length
>> --------+----------+----------+--------------
>>  {}     | f        |          |            0
>> 3) ERROR:  ACL arrays must be one-dimensional
>>
>>
>> also it can be reproduced on some 9.2 version
>
> Can someone comment on this bug report?

It looks legit on first glance.  Probably there's code someplace that
is setting ndims to 1 unconditionally, instead of setting it to 1 when
there are elements and 0 when there are none.  On the other hand,
changing that might break things too, because I'm fairly sure we have
code in a variety of places that verifies that arrays in system
catalogs are always 1-D.  So fixing this could be quite a chore.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2014-02-05 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 16:17 BUG #8395: empty aclitem arrays are considered 1-dimensional bashtanov@imap.cc
2014-01-31 23:37 ` Bruce Momjian <bruce@momjian.us>
2014-02-05 14:29   ` Robert Haas <robertmhaas@gmail.com>

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