aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Cramer <davec@fastcrypt.com>2002-03-05 03:46:03 +0000
committerDave Cramer <davec@fastcrypt.com>2002-03-05 03:46:03 +0000
commit17b6baf17dc5ea72f4739e66e1bec77d413155a9 (patch)
treea6719580a1e1290e94d6f97c3c1e5003ed823bbd /src
parentfe4e95f68285a177a473dbfda352f029a5bfec6f (diff)
downloadpostgresql-17b6baf17dc5ea72f4739e66e1bec77d413155a9.tar.gz
postgresql-17b6baf17dc5ea72f4739e66e1bec77d413155a9.zip
Doug Fields patch to prevent exception being thrown on zero length arrays
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/Array.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
index 14948e5b4b0..f68106ee7b6 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
@@ -74,7 +74,13 @@ public class Array implements java.sql.Array
Object retVal = null;
ArrayList array = new ArrayList();
- if ( rawString != null )
+
+ /* Check if the String is also not an empty array
+ * otherwise there will be an exception thrown below
+ * in the ResultSet.toX with an empty string.
+ * -- Doug Fields <dfields-pg-jdbc@pexicom.com> Feb 20, 2002 */
+
+ if ( rawString != null && !rawString.equals("{}") )
{
char[] chars = rawString.toCharArray();
StringBuffer sbuf = new StringBuffer();