From: Bruce Momjian Date: Tue, 21 Aug 2001 21:29:42 +0000 (+0000) Subject: Here's a resend of the patch.gz. I gunzip'ed it fine here X-Git-Tag: REL7_2_BETA1~646 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8f7bfc09526a5ba25a9f9b4ae9ce8509f6ceced;p=postgresql Here's a resend of the patch.gz. I gunzip'ed it fine here so it may be a transit problem. Also removed the 'txt' suffix in case that was confusing some transport layer trying to be too inteligent for our own good. This may have been because the Array.java class from the previous patch didn't seem to have made it into the snapshot build for some reason. This patch should at least fix that issue. Greg Zoller --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java index 4b9931084f..5e0f86ea35 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java @@ -25,10 +25,11 @@ import org.postgresql.util.*; public class Array implements java.sql.Array { - private org.postgresql.Connection conn = null; - private org.postgresql.Field field = null; - private org.postgresql.jdbc2.ResultSet rs = null; - private int idx = 0; + private org.postgresql.Connection conn = null; + private org.postgresql.Field field = null; + private org.postgresql.jdbc2.ResultSet rs = null; + private int idx = 0; + private String rawString = null; /** * Create a new Array @@ -38,11 +39,14 @@ public class Array implements java.sql.Array * @param field the Field descriptor for the field to load into this Array * @param rs the ResultSet from which to get the data for this Array */ - public Array( org.postgresql.Connection conn, int idx, Field field, org.postgresql.jdbc2.ResultSet rs ) { + public Array( org.postgresql.Connection conn, int idx, Field field, org.postgresql.jdbc2.ResultSet rs ) + throws SQLException + { this.conn = conn; this.field = field; this.rs = rs; this.idx = idx; + this.rawString = rs.getFixedString(idx); } public Object getArray() throws SQLException { @@ -66,9 +70,8 @@ public class Array implements java.sql.Array Object retVal = null; ArrayList array = new ArrayList(); - String raw = rs.getFixedString(idx); - if( raw != null ) { - char[] chars = raw.toCharArray(); + if( rawString != null ) { + char[] chars = rawString.toCharArray(); StringBuffer sbuf = new StringBuffer(); boolean foundOpen = false; boolean insideString = false; @@ -200,8 +203,8 @@ public class Array implements java.sql.Array fields[1] = new Field(conn, "VALUE", field.getOID("bool"), 1); for( int i=0; i