------=_Part_33668_25393407.1204593893981
Content-Type: multipart/alternative;
boundary="----=_Part_33669_10899980.1204593893981"
------=_Part_33669_10899980.1204593893981
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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*
------=_Part_33669_10899980.1204593893981
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<span style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);">Hi,</span><br style="font-family: verdana,sans-serif; color: rgb(0,
0, 0);"><br style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);"><span style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);">While reading the code, the PGSet->MoveNext() definition seems to
have a small bug.</span><br style="font-family: verdana,sans-serif; color:
rgb(0, 0, 0);">
<br style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);"><span
style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">Since the
PGSet->EOF() is defined as </span><br style="font-family:
verdana,sans-serif; color: rgb(0, 0, 0);">
<span style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">bool
Eof() const { return (!nRows || pos > nRows); }</span><br
style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);"><br
style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">
<span style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">I
think it doesn't make sense to define PGSet->MoveNext()
as</span><br style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);"><span style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);">void MoveNext() { if (pos <= nRows) pos++; }</span><br
style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">
<br style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);"><span
style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">It should
rather be </span><br style="font-family: verdana,sans-serif; color: rgb(0,
0, 0);">
<span style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">void
MoveNext() { if (pos < nRows) pos++; }</span><br style="font-family:
verdana,sans-serif; color: rgb(0, 0, 0);"><br style="font-family:
verdana,sans-serif; color: rgb(0, 0, 0);">
<span style="font-family: verdana,sans-serif; color: rgb(0, 0, 0);">The
attached patch does the same.</span><br style="font-family:
verdana,sans-serif; color: rgb(0, 0, 0);"><br style="font-family:
verdana,sans-serif; color: rgb(0, 0, 0);">
<span style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);">Regards,</span><br style="font-family: verdana,sans-serif; color:
rgb(0, 0, 0);"><b style="font-family: verdana,sans-serif; color: rgb(0, 0,
0);">Robins Tharakan</b><br style="font-family: verdana,sans-serif; color:
rgb(0, 0, 0);">
------=_Part_33669_10899980.1204593893981--
------=_Part_33668_25393407.1204593893981
Content-Type: text/x-patch; name=pgset_movenext_bug.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fddrmxsf0
Content-Disposition: attachment; filename=pgset_movenext_bug.patch
SW5kZXg6IHBnYWRtaW4vaW5jbHVkZS9kYi9wZ1NldC5oCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT0KLS0tIHBnYWRtaW4vaW5jbHVkZS9kYi9wZ1NldC5oCShy
ZXZpc2lvbiA3MTA4KQorKysgcGdhZG1pbi9pbmNsdWRlL2RiL3BnU2V0LmgJ
KHdvcmtpbmcgY29weSkKQEAgLTQxLDcgKzQxLDcgQEAKICAgICBsb25nIE51
bVJvd3MoKSBjb25zdCB7IHJldHVybiBuUm93czsgfQogICAgIGxvbmcgTnVt
Q29scygpIGNvbnN0IHsgcmV0dXJuIG5Db2xzOyB9CiAKLSAgICB2b2lkIE1v
dmVOZXh0KCkgeyBpZiAocG9zIDw9IG5Sb3dzKSBwb3MrKzsgfQorICAgIHZv
aWQgTW92ZU5leHQoKSB7IGlmIChwb3MgPCBuUm93cykgcG9zKys7IH0KICAg
ICB2b2lkIE1vdmVQcmV2aW91cygpIHsgaWYgKHBvcyA+IDApIHBvcy0tOyB9
CiAgICAgdm9pZCBNb3ZlRmlyc3QoKSB7IGlmIChuUm93cykgcG9zPTE7IGVs
c2UgcG9zPTA7IH0KICAgICB2b2lkIE1vdmVMYXN0KCkgeyBwb3M9blJvd3M7
IH0K
------=_Part_33668_25393407.1204593893981
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@[EMAIL PROTECTED]
)
To make changes to your Subscription:
http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgadmin-hackers
------=_Part_33668_25393407.1204593893981--


|