Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGIgT-0003h9-0D for pgsql-odbc@arkaria.postgresql.org; Thu, 20 Feb 2014 01:44:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGIgS-0004gL-FZ for pgsql-odbc@arkaria.postgresql.org; Thu, 20 Feb 2014 01:44:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGIgR-0004gE-M0 for pgsql-odbc@postgresql.org; Thu, 20 Feb 2014 01:44:15 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGIgM-0006Rf-Nk for pgsql-odbc@postgresql.org; Thu, 20 Feb 2014 01:44:15 +0000 Received: (qmail 16667 invoked by uid 512); 20 Feb 2014 01:44:05 -0000 Received: from unknown (HELO ?100.0.33.224?) (100.0.33.224) by sd2.tpf-fw-c.co.jp with SMTP; 20 Feb 2014 01:44:05 -0000 Message-ID: <53055DD8.2050309@tpf.co.jp> Date: Thu, 20 Feb 2014 10:43:52 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Heikki Linnakangas CC: =?UTF-8?B?TmlscyBHw7ZzY2hl?= , pgsql-odbc@postgresql.org Subject: Re: Null Characters in Strings, Version 9.3.1 References: <006a01cf28e4$7c425450$74c6fcf0$@de> <003201cf2ccb$c5d6ddd0$51849970$@de> <5303960F.3050706@vmware.com> <003b01cf2ce1$2e33bc80$8a9b3580$@de> <5303C2EA.7060109@vmware.com> <5303F655.8000200@tpf.co.jp> <5304ADB1.6090306@vmware.com> In-Reply-To: <5304ADB1.6090306@vmware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org (2014/02/19 22:12), Heikki Linnakangas wrote: > On 02/19/2014 02:09 AM, Hiroshi Inoue wrote: >> (2014/02/19 5:30), Heikki Linnakangas wrote: >>> On 02/18/2014 09:39 PM, Nils Gösche wrote: >>>> If I run this with version 9.2.1 of the driver (I am using 32 Bit >>>> here), it will go to the else clause and print the value of the text >>>> column. However, if I run this with the latest version, I get the >>>> following output: >>> >>> Hmm. If you could pinpoint it to the exact commit that changed the >>> behavior, that would help too. >> >> Maybe it's caused by the commit 3666c87c1440862bde2e6b8f43ee585deed70d31 >> Author: Hiroshi Inoue >> Date: Thu Aug 22 20:40:01 2013 +0900 >> >> When LF->CR+LF conversion causes an buffer truncation, supress the >> conversion (in case of unicode). >> >> Nils, please try to turn off *LF <-> CR/LF conversion* option. >> Anyway I can't think of the way to cure the problem other than putting >> back the commit. > > Hmm, what was the point of that commit in the first place? I don't think > it was a good idea. If your application needs CR+LF, it's not going to > be happy if you sometimes don't do the conversion. Better to truncate. The commit was for e.g. columns bound by SQLBindCols. In such cases truncated data can't be seen any more. I forgot about SQLGetData() when applying the commit. I already put back the commit. > While looking into this, I found the conversion functions difficult to > debug, because it's defined by the def_utf2ucs macro. It would be much > more natural to have one regular function with an argument to indicate > if it should do error-checking. It used to be a regular function, but > commit ca1daf08f0eef73222abcd8aafe96b8e29afff91 turned it into a macro. > Not sure why; premature optimization perhaps? I didn't want to open error-checking on the face because the use cases are considerably depended on luck. > I propose the attached patch. It turns the utf8_to_ucs2_lf function back > into a regular function, and reverts the troublesome commit > 3666c87c1440862bde2e6b8f43ee585deed70d31. It also adds a regression test > case similar to Nils'. Barring objections, I'll commit this. I don't object to the patch. regards, Hiroshi Inoue -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc