Re: [PATCHES] JDBC: Wrong type

From: Barry Lind <blind(at)xythos(dot)com>
To: Fernando Nasser <fnasser(at)redhat(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] JDBC: Wrong type
Date: 2003-05-29 04:53:32
Message-ID: 3ED5924C.3000204@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Fernando,

Patch applied.

thanks,
--Barry

Fernando Nasser wrote:
> Just to small code fixes, harmless with the current code (I think), but
> it is not the right thing to do in any case.
>
> The first case in this patch was already detected by Chris Smith and was
> part of a patch he proposed for streaming data.
>
> The second instance is part of a similar patch with another streaming
> solution I've been using.
>
> This is just an oversight that should be corrected regardless of the
> cited patches, so I decided to post these changes independently.
>
>
> ------------------------------------------------------------------------
>
> Index: src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v
> retrieving revision 1.21
> diff -c -p -r1.21 AbstractJdbc1Statement.java
> *** src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java 2003/05/03 20:40:45 1.21
> --- src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java 2003/05/14 05:58:21
> *************** public abstract class AbstractJdbc1State
> *** 132,138 ****
> v.addElement(l_sql.substring (lastParmEnd, l_sql.length()));
>
> m_sqlFragments = new String[v.size()];
> ! m_binds = new String[v.size() - 1];
> m_bindTypes = new String[v.size() - 1];
>
> for (i = 0 ; i < m_sqlFragments.length; ++i)
> --- 132,138 ----
> v.addElement(l_sql.substring (lastParmEnd, l_sql.length()));
>
> m_sqlFragments = new String[v.size()];
> ! m_binds = new Object[v.size() - 1];
> m_bindTypes = new String[v.size() - 1];
>
> for (i = 0 ; i < m_sqlFragments.length; ++i)
> Index: src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v
> retrieving revision 1.13
> diff -c -p -r1.13 AbstractJdbc2Statement.java
> *** src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2003/03/14 01:21:47 1.13
> --- src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2003/05/14 05:58:22
> *************** public abstract class AbstractJdbc2State
> *** 175,181 ****
> l_newSqlFragments = new String[m_sqlFragments.length];
> System.arraycopy(m_sqlFragments,0,l_newSqlFragments,0,m_sqlFragments.length);
> }
> ! Object[] l_newBinds = new String[m_binds.length];
> System.arraycopy(m_binds,0,l_newBinds,0,m_binds.length);
> String[] l_newBindTypes = new String[m_bindTypes.length];
> System.arraycopy(m_bindTypes,0,l_newBindTypes,0,m_bindTypes.length);
> --- 175,181 ----
> l_newSqlFragments = new String[m_sqlFragments.length];
> System.arraycopy(m_sqlFragments,0,l_newSqlFragments,0,m_sqlFragments.length);
> }
> ! Object[] l_newBinds = new Object[m_binds.length];
> System.arraycopy(m_binds,0,l_newBinds,0,m_binds.length);
> String[] l_newBindTypes = new String[m_bindTypes.length];
> System.arraycopy(m_bindTypes,0,l_newBindTypes,0,m_bindTypes.length);
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-05-29 04:58:02 Re: JDBC in Red hat 9
Previous Message Barry Lind 2003-05-29 04:49:01 Re: JDBC: Better initial capacity for StringBuffers reduces

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2003-05-29 05:39:44 Re: array support patch phase 1 patch
Previous Message Barry Lind 2003-05-29 04:49:01 Re: JDBC: Better initial capacity for StringBuffers reduces