Re: patch: tiny patch to correct stringbuffer size estimate - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: patch: tiny patch to correct stringbuffer size estimate
Date
Msg-id 3F3806C0.1050009@xythos.com
Whole thread Raw
In response to patch: tiny patch to correct stringbuffer size estimate  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Patch applied.

--Barry


Oliver Jowett wrote:
> This patch tweaks the size estimate when escaping strings to count the
> enclosing quotes.
>
> -O
>
>
> ------------------------------------------------------------------------
>
> Index: AbstractJdbc1Statement.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v
> retrieving revision 1.28
> diff -u -c -r1.28 AbstractJdbc1Statement.java
> *** AbstractJdbc1Statement.java    22 Jul 2003 05:17:09 -0000    1.28
> --- AbstractJdbc1Statement.java    22 Jul 2003 13:53:03 -0000
> ***************
> *** 1034,1040 ****
>               synchronized (sbuf)
>               {
>                   sbuf.setLength(0);
> !                 sbuf.ensureCapacity(x.length() + (int)(x.length() / 10));
>                   sbuf.append('\'');
>                   escapeString(x, sbuf);
>                   sbuf.append('\'');
> --- 1034,1040 ----
>               synchronized (sbuf)
>               {
>                   sbuf.setLength(0);
> !                 sbuf.ensureCapacity(2 + x.length() + (int)(x.length() / 10));
>                   sbuf.append('\'');
>                   escapeString(x, sbuf);
>                   sbuf.append('\'');
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



pgsql-jdbc by date:

Previous
From: Savio Domnic
Date:
Subject: Re: how to connect jdk with postgreSQL
Next
From: Barry Lind
Date:
Subject: Re: patch: clean up exception formatting