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

Error when getting text longer than MaxLongVarcharSize

From: Åsmund Kveim Lie <akl(at)nosyko(dot)no>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Error when getting text longer than MaxLongVarcharSize
Date: 2006-03-30 12:35:19
Message-ID: 442BD087.4080309@nosyko.no (view raw or flat)
Thread:
Lists: pgsql-odbc
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



Responses

pgsql-odbc by date

Next:From: Johann ZuschlagDate: 2006-03-30 19:41:06
Subject: Unicode is not UTF-8. was :psqlODBC-Driver Test / text fields
Previous:From: noreplyDate: 2006-03-30 10:47:07
Subject: [ psqlodbc-Bugs-1000601 ] Strange different behaviour of with SQLColAttribute with SQL_DESC_OCTET or SQL_DESC_LENGHT

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