pgSet MoveNext bug ?

From: "Robins Tharakan" <tharakan(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: pgSet MoveNext bug ?
Date: 2008-03-04 01:24:53
Message-ID: 36af4bed0803031724s681693e2pf392db9dfac4b5b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi,

While reading the code, the PGSet->MoveNext() definition seems to have a
small bug.

Since the PGSet->EOF() is defined as
bool Eof() const { return (!nRows || pos > nRows); }

I think it doesn't make sense to define PGSet->MoveNext() as
void MoveNext() { if (pos <= nRows) pos++; }

It should rather be
void MoveNext() { if (pos < nRows) pos++; }

The attached patch does the same.

Regards,
*Robins Tharakan*

Attachment Content-Type Size
pgset_movenext_bug.patch text/x-patch 542 bytes

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2008-03-04 09:41:52 Re: Display line numbers in SQL view
Previous Message svn 2008-03-03 21:35:39 SVN Commit by dpage: r7111 - trunk/pgadmin3/plugins