Re: suspicous looking code in copy.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: suspicous looking code in copy.c
Дата
Msg-id 12601.1062079080@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: suspicous looking code in copy.c  (Andreas Pflug <pgadmin@pse-consulting.de>)
Список pgsql-hackers
Andreas Pflug <pgadmin@pse-consulting.de> writes:
>> shouldn't it be datasize -= avail ?
>> 
> AFAIR this is a really outdated K&R style of -=  . Compilers *should* 
> recognize this (and will throw an ambiguity error if there's no space 
> after =- ), but it's better to use the 'newer' style.

Dave didn't quote it accurately.  It was actually

diff -r1.209 copy.c
435c435
<                               datasize = -avail;
---
>                               datasize -= avail;

which is just plain wrong ... the net effect being that COPY IN BINARY
would fail to cope with fields crossing message packet boundaries.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: suspicous looking code in copy.c
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Index creation takes for ever