Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4451B1337B9F for ; Wed, 10 Nov 2010 00:04:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88510-05 for ; Wed, 10 Nov 2010 04:04:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.qbik.com (smtp.qbik.com [210.55.214.35]) by mail.postgresql.org (Postfix) with ESMTP id 08B561337B86 for ; Wed, 10 Nov 2010 00:04:25 -0400 (AST) Received: From [210.55.214.39] (unverified [210.55.214.39]) by SMTP Server [210.55.214.35] (WinGate SMTP Receiver v7.0.0 (Build 3068)) with SMTP id <0017697660@smtp.qbik.com>; Wed, 10 Nov 2010 17:04:21 +1300 Message-ID: <4CDA19C5.8070607@qbik.com> Date: Wed, 10 Nov 2010 17:04:21 +1300 From: Adrien de Croy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Hiroshi Inoue CC: "pgsql-odbc@postgresql.org" Subject: Re: Access violation (0xC0000005) in PSQLODBC35W.DLL when calling SQLDescribeColW References: <6B48F83ECA0ABA4F9E360E8E0A1CDFFC35E4AE0E@HALLEY.maeil.pt> <4CD09C7F.9070403@tpf.co.jp> <4CD0D584.30908@qbik.com> <4CD11F17.5050207@tpf.co.jp> <4CD24723.5020203@qbik.com> <4CD3374A.1040003@qbik.com> <4CD3C5F1.80606@tpf.co.jp> <4CD9F9ED.3000201@qbik.com> <4CDA16F7.10402@tpf.co.jp> In-Reply-To: <4CDA16F7.10402@tpf.co.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_PSBL=2.7, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/23 X-Sequence-Number: 10508 Hi I have some helper classes to fetch fields from a record, a helper class to manage iteration through a result set. If I call my fetch helper function for some field ordinal it works fine the first time. If I call it again (without having called any method to change the current row in the result set) it fails on the same ordinal, but works on other ordinals. So, it looks to me like the fetch call is cleaning up the field data when you fetch, rather than cleaning up the row when you say move to the next row. I don't know if this is a bug or not - for instance MS SQL server fails if you fetch columns in a non-monitonically-increasing column ordinal order. E.g. fetch columns 1, 2, 3 works but not 1, 3, 2. So maybe ODBC doesn't guarantee it's safe to call fetch columns 1, 1, x Adrien On 10/11/2010 4:52 p.m., Hiroshi Inoue wrote: > Hi Adrien, > > (2010/11/10 10:48), Adrien de Croy wrote: >> >> also seems to break the table scheme. This one isn't important to me, >> but maybe to others. >> >> One other thing I found, even on the 9.00.0200 build. >> >> Once you fetch data on a field in a record, if you try to fetch the same >> field on the same row again (without moving cursor or anything) it blows >> up also. fetching seems to alter what you fetch. > > What do you mean by *fetch(again)*? > > regards, > Hiroshi Inoue > >> >> On 5/11/2010 9:53 p.m., Hiroshi Inoue wrote: >>> Hi、 >>> >>> (2010/11/05 7:44), Adrien de Croy wrote: >>>> >>>> Hi all >>>> >>>> I'm getting an access violation from within SQLDescribeColW when I'm >>>> getting the result scheme from a query. >>> >>> Hmm I may have introduced a bug in 9.0.0200. >>> >>> Could you please try the drivers on testing for 9.0.0201 at >>> http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/ >>> ? >>> >>> regards, >>> Hiroshi Inoue >>> >>>> the query is pretty simple: >>>> >>>> SELECT count(*) as folder_files, sum(file_size) as folder_size, >>>> sum(disk_use) as folder_size_disk, folder_id from cache_index where >>>> volume_id = %u group by folder_id >>>> >>>> SQLExecute returns OK >>>> SQLNumResultCols returns 4 columns as expected >>>> >>>> the SQLDescribeColW blows up when calling with column #2, >>>> corresponding >>>> to sum(file_size). file_size is a bigint field. There are only 5 >>>> records, and the sum of the file_size is under 1MB. So shouldn't be >>>> any >>>> bigint overflow or something. >>>> >>>> I used to use a double precision and it worked fine, then I figured >>>> out >>>> how to store into a bigint field and now this happens every time I do >>>> this query if there are any records in the table. If there are no >>>> records it's fine. >>>> >>>> Regards >>>> >>>> Adrien de Croy >>> >>> >> >> >> >> > >