Skip to content

Commit 80bbd32

Browse files
author
Barry Lind
committed
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
1 parent ec7aa4b commit 80bbd32

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/interfaces/jdbc/org/postgresql/Driver.java.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.31 2003/06/30 16:38:30 barry Exp $
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.32 2003/07/21 20:48:31 barry Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -503,6 +503,6 @@ public class Driver implements java.sql.Driver
503503

504504

505505
//The build number should be incremented for every new build
506-
private static int m_buildNumber = 205;
506+
private static int m_buildNumber = 206;
507507

508508
}

src/interfaces/jdbc/org/postgresql/jdbc2/Array.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,20 @@ public Object getArray(long index, int count, Map map) throws SQLException
9898
if ( chars[i] == '\\' )
9999
//escape character that we need to skip
100100
i++;
101-
if ( chars[i] == '{' )
101+
else if (!insideString && chars[i] == '{' )
102102
{
103103
if ( foundOpen ) // Only supports 1-D arrays for now
104104
throw org.postgresql.Driver.notImplemented();
105105
foundOpen = true;
106106
continue;
107107
}
108-
if ( chars[i] == '"' )
108+
else if (chars[i] == '"')
109109
{
110110
insideString = !insideString;
111111
continue;
112112
}
113-
if ( (!insideString && chars[i] == ',') || chars[i] == '}' || i == chars.length - 1)
113+
else if (!insideString && (chars[i] == ',' || chars[i] == '}') ||
114+
i == chars.length - 1)
114115
{
115116
if ( chars[i] != '"' && chars[i] != '}' && chars[i] != ',' )
116117
sbuf.append(chars[i]);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy