Re: suspicous looking code in copy.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: suspicous looking code in copy.c
Date
Msg-id 12601.1062079080@sss.pgh.pa.us
Whole thread Raw
In response to Re: suspicous looking code in copy.c  (Andreas Pflug <pgadmin@pse-consulting.de>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: suspicous looking code in copy.c
Next
From: Tom Lane
Date:
Subject: Re: Index creation takes for ever