pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Åsmund Kveim Lie <akl@nosyko.no>
To: pgsql-odbc@postgresql.org
Subject: Error when getting text longer than MaxLongVarcharSize
Date: Thu, 30 Mar 2006 14:35:19 +0200
Message-ID: <442BD087.4080309@nosyko.no> (raw)

Hi,

When fetching text data longer than MaxLongVarcharSize, the driver 
returns the length of the actual data in the database rather than the 
truncated length to retrieve.

The last parameter (StrLen_or_IndPtr) to SQLBindCol() is a pointer to 
where to place the length of the data to get. When we later call 
SQLExtendedFetch() it will update this value to be the length of the 
string. If you have a text in the database which is longer than the 
MaxLongVarcharSize the ODBC will truncate the value to return down to 
MaxLongVarcharSize (as printed in the log file).

The bug is that in version 08.01.200 (ANSI) SQLExtendedFetch() updates 
the string length to be the length in the database and NOT the length of 
the actual (truncated) value returned. We later rely on this value to 
get the string value from memory. We use PostgreSQL 8.1.3 on Debian 
Sarge and ODBC on Windows.

I hope this is enough information to enable you locate the bug. If you 
need more information or MyLog please let me know, but I have not 
attached it because my posts with log attachments does not seem to get 
through on this mailing list.

Best regards,

Åsmund Lie





view thread (2+ messages)  latest in thread

Message-ID: <442BD087.4080309@nosyko.no>
Permalink:  ../442BD087.4080309@nosyko.no/
Also on:    postgresql.org/message-id/442BD087.4080309@nosyko.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: akl@nosyko.no
  Subject: Re: Error when getting text longer than MaxLongVarcharSize
  In-Reply-To: <442BD087.4080309@nosyko.no>
  References: <442BD087.4080309@nosyko.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox