1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

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
This commit is contained in:
Barry Lind
2003-07-21 20:48:31 +00:00
parent ec7aa4b515
commit 80bbd3281d
2 changed files with 6 additions and 5 deletions
src/interfaces/jdbc/org/postgresql

@ -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]);