Re: jdbc 7.0 fix for off by one errors. - Mailing list pgsql-interfaces

From Joseph Shraibman
Subject Re: jdbc 7.0 fix for off by one errors.
Date
Msg-id 39203607.3F069C3B@selectacast.net
Whole thread Raw
List pgsql-interfaces
Peter Mount wrote:

> Now I've seen this, I remember putting it in. If someone else hasn't
> done it yet I'll do it now.
>

Momjian put it in on friday after I submitted it to the patches list.  I
would have submitted it there first, but there are so many lists I can't
keep track of them all :s  Anyway, it's in.


>
> Peter
>
> --
> Peter Mount
> Enterprise Support
> Maidstone Borough Council
> Any views stated are my own, and not those of Maidstone Borough Council.
>
> -----Original Message-----
> From: Joseph Shraibman [mailto:jks@p1.selectacast.net]
> Sent: Thursday, May 11, 2000 8:18 PM
> To: pgsql-interfaces@postgreSQL.org; pgsql-hackers@postgresql.org
> Subject: [INTERFACES] jdbc 7.0 fix for off by one errors.
>
> Peter, not only didn't you fix the off by one errors in ResultSet from
> 6.5.3, you added more!
>
> I'm including a diff of
> postgresql-7.0/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java.
> I've clearly marked all the fixes I did. Would *someone* who has access
> to the cvs please put this in?
>
> ======================
>
> 8d7
> <
> 799,801c798,802
> <     {
> <  current_row = rows.size() + 1;
> <     }
> ---
> >     {//fixed by Joseph Shraibman <jks@selectacast.net>
> >  //current_row = rows.size() + 1;
> >  if (rows.size() > 0)
> >      current_row = rows.size();
> >    }
> 804,805c805,808
> <     {
> <  current_row = 0;
> ---
> >     {//fixed by Joseph Shraibman <jks@selectacast.net>
> >  //current_row = 0;
> >  if (rows.size() > 0)
> >      current_row = -1;
> 949c952
> <  return current_row;
> ---
> >  return current_row + 1;//fixed by Joseph Shraibman
> <jks@selectacast.net>
> 967c970,972
> <
> ---
> >     /**
> >      * @author Joseph Shraibman <jks@selectacast.net>
> >      */
> 970,972c975,980
> <  throw org.postgresql.Driver.notImplemented();
> <     }
> <
> ---
> >  //throw org.postgresql.Driver.notImplemented();
> >  return (current_row >= rows.size()  && rows.size() > 0);
> >    }
> >     /**
> >      * @author Joseph Shraibman <jks@selectacast.net>
> >      */
> 974,975c982,984
> <     {
> <  throw org.postgresql.Driver.notImplemented();
> ---
> >     {
> >  return (current_row < 0 && rows.size() > 0);
> >  //throw org.postgresql.Driver.notImplemented();
> 977c986,988
> <
> ---
> >     /**
> >      * @author Joseph Shraibman <jks@selectacast.net>
> >      */
> 980c991,992
> <  throw org.postgresql.Driver.notImplemented();
> ---
> >  return (current_row == 0 && rows.size() >= 0);
> >  //throw org.postgresql.Driver.notImplemented();
> 985c997,998
> <  throw org.postgresql.Driver.notImplemented();
> ---
> >  return (current_row == rows.size() -1  && rows.size() > 0);
> >  //throw org.postgresql.Driver.notImplemented();



pgsql-interfaces by date:

Previous
From: Steve Holmes
Date:
Subject: Re: Cannot update PGSQL databes via ODBC
Next
From: Joseph Shraibman
Date:
Subject: Re: [HACKERS] RE: jdbc 7.0 fix for off by one errors.