diff options
author | Barry Lind <barry@xythos.com> | 2003-06-30 16:38:30 +0000 |
---|---|---|
committer | Barry Lind <barry@xythos.com> | 2003-06-30 16:38:30 +0000 |
commit | 9af05a9d10807fda418163e69074881d8f4ffb9d (patch) | |
tree | 0d6d30f4dd6f80e56991e71d16e54dedab815f07 /src/interfaces/jdbc/org/postgresql/Driver.java.in | |
parent | 835bb975d8d11268582d9dbd26b0eeaa62b60632 (diff) |
Patches applied:
1) Patch from Kris Jurka to fix IPv6 parsing of the jdbc URL
2) Patch from Kris Jurka to fix an ArrayIndexOutOfBounds error
when calling moveToCurrentRow while currentRow is "beforeFirst"
3) Patch from Kim Ho to fix add some bounds checking in setMaxRows(),
setQueryTimeout(), setFetchSize()
Modified Files:
jdbc/org/postgresql/Driver.java.in
jdbc/org/postgresql/errors.properties
jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/Driver.java.in')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/Driver.java.in | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/Driver.java.in b/src/interfaces/jdbc/org/postgresql/Driver.java.in index e37428491ac..96754e5b846 100644 --- a/src/interfaces/jdbc/org/postgresql/Driver.java.in +++ b/src/interfaces/jdbc/org/postgresql/Driver.java.in @@ -6,7 +6,7 @@ * Copyright (c) 2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.30 2003/05/29 04:39:51 barry Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.31 2003/06/30 16:38:30 barry Exp $ * *------------------------------------------------------------------------- */ @@ -272,6 +272,17 @@ public class Driver implements java.sql.Driver l_urlArgs = url.substring(l_qPos+1); } + // look for an IPv6 address that is enclosed by [] + // the upcoming parsing that uses colons as identifiers can't handle + // the colons in an IPv6 address. + int ipv6start = l_urlServer.indexOf("["); + int ipv6end = l_urlServer.indexOf("]"); + String ipv6address = null; + if (ipv6start != -1 && ipv6end > ipv6start) { + ipv6address = l_urlServer.substring(ipv6start+1,ipv6end); + l_urlServer = l_urlServer.substring(0,ipv6start)+"ipv6host"+l_urlServer.substring(ipv6end+1); + } + //parse the server part of the url StringTokenizer st = new StringTokenizer(l_urlServer, ":/", true); for (int count = 0; (st.hasMoreTokens()); count++) @@ -346,6 +357,10 @@ public class Driver implements java.sql.Driver } } + // if we extracted an IPv6 address out earlier put it back + if (ipv6address != null) + urlProps.put("PGHOST",ipv6address); + //parse the args part of the url StringTokenizer qst = new StringTokenizer(l_urlArgs, "&"); for (int count = 0; (qst.hasMoreTokens()); count++) |