Re: suspicous looking code in copy.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: dave(at)fastcrypt(dot)com, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: suspicous looking code in copy.c
Date: 2003-08-28 13:58:00
Message-ID: 12601.1062079080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andreas Pflug <pgadmin(at)pse-consulting(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bowlby 2003-08-28 14:05:17 Re: Hardware recommendations to scale to silly load
Previous Message Tom Lane 2003-08-28 13:49:47 Re: suspicous looking code in copy.c