summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2003-07-21 20:48:31 +0000
committerBarry Lind <barry@xythos.com>2003-07-21 20:48:31 +0000
commit80bbd3281d9f598779c363bc792b2d2c9a8b48c3 (patch)
treedbb837dce5b8ace37f3d274cba6429ae9469e619 /src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
parentec7aa4b51545e0c1c69acc0cf135d9c229f61d11 (diff)
downloadpostgresql-80bbd3281d9f598779c363bc792b2d2c9a8b48c3.tar.gz
Applied patch from dmitry@openratings.com to fix parsing of array values
Modified Files: jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/jdbc2/Array.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/Array.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/Array.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
index 973da1d2b0..418a094263 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java
@@ -98,19 +98,20 @@ public class Array implements java.sql.Array
if ( chars[i] == '\\' )
//escape character that we need to skip
i++;
- if ( chars[i] == '{' )
+ else if (!insideString && chars[i] == '{' )
{
if ( foundOpen ) // Only supports 1-D arrays for now
throw org.postgresql.Driver.notImplemented();
foundOpen = true;
continue;
}
- if ( chars[i] == '"' )
+ else if (chars[i] == '"')
{
insideString = !insideString;
continue;
}
- if ( (!insideString && chars[i] == ',') || chars[i] == '}' || i == chars.length - 1)
+ else if (!insideString && (chars[i] == ',' || chars[i] == '}') ||
+ i == chars.length - 1)
{
if ( chars[i] != '"' && chars[i] != '}' && chars[i] != ',' )
sbuf.append(chars[i]);