Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers

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.

*Robins Tharakan*

Attachment: pgset_movenext_bug.patch
Description: text/x-patch (542 bytes)


pgadmin-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group