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

Patch for handling long null terminated strings in JDBC driver

From: Barry Lind <barry(at)xythos(dot)com>
To: "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Cc: pgsql-jdbc(at)postgresql(dot)org, swampler(at)noao(dot)edu
Subject: Patch for handling long null terminated strings in JDBC driver
Date: 2001-07-12 21:16:41
Message-ID: 3B4E13B9.30205@xythos.com (view raw or flat)
Thread:
Lists: pgsql-jdbcpgsql-patches
The attached patch fixes problems with the JDBC driver handling long 
null terminated strings.  The FE/BE protocol sends in some cases null 
terminated strings to the client.  The docs for the FE/BE protocol state 
that there is no limit on the size of a null terminated string sent to 
the client and a client should be coded using an expanding buffer to 
deal with large strings.  The old code did not do this and gave an error 
if a null terminated string was greater than either 4 or 8K.  It appears 
that with the advent of TOAST very long SQL statements are becoming more 
common, and apparently some error messages from the backend include the 
SQL statement thus easily exceeding the 8K limit in the old code.

In fixing I also cleaned up some calls in the JDBC fastpath code that 
were not doing character set conversion under multibyte, and removed 
some methods that were no longer needed.  I also removed a potential 
threading problem with a shared variable that was being used in 
Connection.java.

Thanks to Steve Wampler for discovering the problem and sending the 
initial diffs that were the basis of this patch.

thanks,
--Barry

Attachment: patch.txt
Description: text/plain (11.6 KB)

Responses

pgsql-patches by date

Next:From: Martijn van OosterhoutDate: 2001-07-12 23:28:44
Subject: Patch to add support for partial indices
Previous:From: Bruce MomjianDate: 2001-07-12 20:35:51
Subject: Re: patch for spelling mistake

pgsql-jdbc by date

Next:From: Dejan VucinicDate: 2001-07-12 21:22:45
Subject: Resolved: can't write a BLOB, 7.1.2
Previous:From: Bruce MomjianDate: 2001-07-12 20:34:59
Subject: Re: Re: [PATCHES] Re: [PATCH] Cleanup of JDBC character encoding

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group