Re: BUG #5748: Invalid oidvector data during binary recv

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #5748: Invalid oidvector data during binary recv
Дата
Msg-id 4CE10E39.9080806@enterprisedb.com
обсуждение исходный текст
Ответ на Re: BUG #5748: Invalid oidvector data during binary recv  (Yeb Havinga <yebhavinga@gmail.com>)
Ответы Re: BUG #5748: Invalid oidvector data during binary recv  (Yeb Havinga <yebhavinga@gmail.com>)
Список pgsql-bugs
On 15.11.2010 12:08, Yeb Havinga wrote:
> On 2010-11-11 17:02, Heikki Linnakangas wrote:
>> On 11.11.2010 17:48, Tom Lane wrote:
>>> "Yeb Havinga"<yebhavinga@gmail.com> writes:
>>>> postgres=# create table a as select ''::oidvector;
>>>> SELECT 1
>>>> postgres=# copy a to '/tmp/test' with binary;
>>>> COPY 1
>>>> postgres=# copy a from '/tmp/test' with binary;
>>>> ERROR: invalid oidvector data
>>>
>>> The problem seems to be that array_recv passes back a zero-dimensional
>>> array, *not* a 1-D array, when it observes that the input has no
>>> elements. A zero-D array is not part of the subset of possible arrays
>>> that we allow for oidvector.
>>
>> Yeah, I just reached that conclusion too..
> The patch below changes array_recv, so that it returns an empty 1-D
> array when an empty 1-D array was written binary. No changes in
> oidvectorrecv or int2vectorrecv are needed.

That seems like a bad idea. array_in() represents an empty array with
zero dimensions, we're not going to change the generic array_recv()
function used for all arrays to behave differently because of some
corner-case in oidvectorrecv.

If we want do anything about this, the right fix is to add a special
case in oidvectorrecv/int2vectorrecv to handle empty array.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Yeb Havinga
Дата:
Сообщение: Re: BUG #5748: Invalid oidvector data during binary recv
Следующее
От: Yeb Havinga
Дата:
Сообщение: Re: BUG #5748: Invalid oidvector data during binary recv