Re: BUG #2694: Memory allocation error when selecting array of empty arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vitali Stupin" <Vitali(dot)Stupin(at)ria(dot)ee>
Cc: pgsql-bugs(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: BUG #2694: Memory allocation error when selecting array of empty arrays
Date: 2006-10-16 14:24:02
Message-ID: 20200.1161008642@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Vitali Stupin" <Vitali(dot)Stupin(at)ria(dot)ee> writes:
> The error "invalid memory alloc request size 4294967293" apears when
> selecting array of empty arrays:
> select ARRAY['{}'::text[],'{}'::text[]];

I can get a core dump off it too, sometimes. The problem is in
ExecEvalArray, which computes the dimension of the result as [1:2]
even though there are no elements to put in it.

Joe, what do you think about this? Offhand I think that the only
workable definition is that this case yields another zero-dimensional
array, but maybe there is another choice?

We should probably check all the other array operations to see if they
have comparable problems.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-10-16 14:28:06 Re: [HACKERS] BUG #2683: spi_exec_query in plperl returns
Previous Message Martijn van Oosterhout 2006-10-16 14:10:44 Re: [HACKERS] BUG #2683: spi_exec_query in plperl returns