X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9CB9C11F662F for ; Thu, 30 Mar 2006 08:34:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38177-07 for ; Thu, 30 Mar 2006 08:34:05 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from db.nosyko.no (db.nosyko.no [193.213.210.38]) by postgresql.org (Postfix) with SMTP id 30CEB11F662D for ; Thu, 30 Mar 2006 08:34:02 -0400 (AST) Received: from lurker.nosyko.no ([192.168.20.6] helo=[127.0.0.1]) by db.nosyko.no with esmtp (Exim 4.50) id 1FOwLk-0001lx-Sc for pgsql-odbc@postgresql.org; Thu, 30 Mar 2006 14:34:05 +0200 Message-ID: <442BD087.4080309@nosyko.no> Date: Thu, 30 Mar 2006 14:35:19 +0200 From: =?ISO-8859-1?Q?=C5smund_Kveim_Lie?= User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 192.168.20.6 X-SA-Exim-Mail-From: akl@nosyko.no Subject: Error when getting text longer than MaxLongVarcharSize X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on db.nosyko.no) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.086 required=5 tests=[AWL=0.086] X-Spam-Score: 0.086 X-Spam-Level: X-Archive-Number: 200603/226 X-Sequence-Number: 7512 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