Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Exception in thread "main" java.lang.OutOfMemoryError:





On Mon, 28 Aug 2006, Oliver Jowett wrote:

Sounds like there is a bug in the driver's escape sequence parsing somewhere then. An invalid {...} escape shouldn't cause an OOME.


Indeed. The attached patch fixes this case for me. In general the handling of escapes that aren't correct doesn't look great and should probably be looked at it the future. For example the fact that it only checks the first letter of some escapes and doesn't complain if the second isn't found doesn't look good. Anyway as gborg is down, cvs is down, so I'll commit this one later.

Kris Jurka
diff -rcN clean/org/postgresql/jdbc2/AbstractJdbc2Statement.java good/org/postgresql/jdbc2/AbstractJdbc2Statement.java
*** clean/org/postgresql/jdbc2/AbstractJdbc2Statement.java	Mon May 22 02:52:37 2006
--- good/org/postgresql/jdbc2/AbstractJdbc2Statement.java	Tue Aug 29 22:12:21 2006
***************
*** 911,917 ****
                  // go to the end of the function copying anything found
                  i++;
                  while (i<len && p_sql.charAt(i)!='}')
!                     newsql.append(p_sql.charAt(i));
                  state = IN_SQLCODE; // end of escaped function (or query)
                  break;
              case ESC_TIMEDATE:       
--- 911,917 ----
                  // go to the end of the function copying anything found
                  i++;
                  while (i<len && p_sql.charAt(i)!='}')
!                     newsql.append(p_sql.charAt(i++));
                  state = IN_SQLCODE; // end of escaped function (or query)
                  break;
              case ESC_TIMEDATE:       


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group