Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WI9Ky-0008Ee-JO for pgsql-odbc@arkaria.postgresql.org; Tue, 25 Feb 2014 04:09:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WI9Ky-0005dM-2e for pgsql-odbc@arkaria.postgresql.org; Tue, 25 Feb 2014 04:09:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WI9Kx-0005dF-43 for pgsql-odbc@postgresql.org; Tue, 25 Feb 2014 04:09:43 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WI9Kt-0002kP-OI for pgsql-odbc@postgresql.org; Tue, 25 Feb 2014 04:09:42 +0000 Received: (qmail 25168 invoked by uid 512); 25 Feb 2014 04:09:37 -0000 Received: from unknown (HELO ?127.0.0.1?) (100.126.1.62) by sd2.tpf-fw-c.co.jp with SMTP; 25 Feb 2014 04:09:37 -0000 Message-ID: <530C177F.2030906@tpf.co.jp> Date: Tue, 25 Feb 2014 13:09:35 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Heikki Linnakangas CC: Christoph Berg , PostgreSQL ODBC , psqlodbc@packages.debian.org Subject: Re: 09.03.0100 cursor failures on various architectures References: <20140212104524.GA4409@msgid.credativ.de> <52FE1220.9050205@vmware.com> In-Reply-To: <52FE1220.9050205@vmware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) 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/14 21:54), Heikki Linnakangas wrote: > On 02/12/2014 12:45 PM, Christoph Berg wrote: >> s390x has that problem, plus an additional diff for positioned-update: >> >> *** /«PKGBUILDDIR»/test/expected/positioned-update.out Tue Dec 17 >> 14:16:00 2013 >> --- /«PKGBUILDDIR»/test/results/positioned-update.out Wed Feb 5 >> 17:09:31 2014 >> *************** >> *** 13,19 **** >> 2 2 >> 3 3 >> 4 4 >> ! 105 5 >> 7 7 >> 8 8 >> 9 9 >> --- 13,19 ---- >> 2 2 >> 3 3 >> 4 4 >> ! 5 5 >> 7 7 >> 8 8 >> 9 9 > > This is also an issue related to endianess and mismatched datatypes. The > problem is with the SQLBindCol call. Positioned-update test does this: > > long colvalue; > ... > rc = SQLBindCol(hstmt, 1, SQL_C_LONG, &colvalue, 0, &indColvalue); > > And SQLBindCol does this: > > case SQL_C_SLONG: > case SQL_C_LONG: > len = 4; > if (bind_size > 0) > *((SQLINTEGER *) rgbValueBindRow) = atol(neut_str); > else > *((SQLINTEGER *) rgbValue + bind_row) = atol(neut_str); > break; > > So, SQLBindPos assumes that the target variable is of type SQLINTEGER, > when the caller indicated that it's SQL_C_LONG. My gut reaction is that > that's bogus - if the caller said that it's of C-type long, by passing > SQL_C_LONG, we should believe that, rather than assume that SQL_C_LONG > means SQLINTEGER. I found a brief thread on this on the unixodbc-dev > mailing list: > > http://mailman.unixodbc.org/pipermail/unixodbc-dev/2005-March/000396.html > > The same author raised the issue also on the psqlodbc mailing list: > > http://www.postgresql.org/message-id/flat/4224F80D.2080103@kkcsm.net#4224F80D.2080103@kkcsm.net > > Microsoft has a table of SQL_C_* codes and which C types they correspond > to (http://msdn.microsoft.com/en-us/library/ms714556%28v=vs.85%29.aspx), > but that's not taking into account other operating systems where the > widths of C integer types are different. We didn't explicitly discuss in > that psqlodbc mailing list thread if it's sane that SQL_C_LONG means a > 32-bit integer regardless of how wide the C "long" type actually is. I don't think so. Where do you find references to OS native C types in ODBC's spec? ODBC uses its own SQL types in its spec and each SQL_C_xxxxxxx stands for one of them not a native one. For 32bit integers, use SQL_C_LONG (SQLINTEGER). For 64bit integers, use SQL_C_BIGINT (SQLBIGINT). There's no type named SQLxxLONGxx. I can see the following line in sqlext.h provided by Microsoft or unixODBC. #define SQL_C_LONG SQL_INTEGER /* INTEGER */ It means that those driver manager think SQL_C_LONG means SQLINTEGER. What meaning does it have to take different way from the driver manager whose APIs ODBC applications call? regards, Hiroshi Inoue -- I am using the free version of SPAMfighter. SPAMfighter has removed 5285 of my spam emails to date. Get the free SPAMfighter here: http://www.spamfighter.com/len Do you have a slow PC? Try a Free scan http://www.spamfighter.com/SLOW-PCfighter?cid=sigen -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc