Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 025DA1336971 for ; Mon, 31 Jan 2011 11:55:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 41986-10 for ; Mon, 31 Jan 2011 15:55:09 +0000 (UTC) X-Greylist: delayed 00:06:39.664611 by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id ADF3313364DE for ; Mon, 31 Jan 2011 11:55:08 -0400 (AST) Received: (qmail 31939 invoked by uid 0); 31 Jan 2011 15:48:27 -0000 Received: from 192.124.237.1 by www053.gmx.net with HTTP; Mon, 31 Jan 2011 16:48:24 +0100 (CET) Cc: pgsql-odbc@postgresql.org Content-Type: text/plain; charset="utf-8" Date: Mon, 31 Jan 2011 16:48:24 +0100 From: "Jan-Peter Seifert" In-Reply-To: <4D32C5EB.1060401@tpf.co.jp> Message-ID: <20110131154824.261280@gmx.net> MIME-Version: 1.0 References: <20110114150049.266580@gmx.net> <4D32C5EB.1060401@tpf.co.jp> Subject: Re: Problem with high OIDs because of changed atol behaviour To: Hiroshi Inoue X-Authenticated: #955937 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+z9FVjRwKzqNAIAPTPGCJccE9SyE5iJjBwyY/Lf5 DymhDYY6zhmImUcHWQdDL3RI3jxyvhhWJAAw== Content-Transfer-Encoding: 8bit X-GMX-UID: ++B1dSVSMmA6VEr6ZWFn+xY5MjQ1N92I X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201101/25 X-Sequence-Number: 10572 Hello Inoue-san, sorry for asking again. So will there be an official patch for this problem? Could you tell me, please? Thank you very much in advance, Peter -------- Original-Nachricht -------- > Datum: Sun, 16 Jan 2011 19:18:19 +0900 > Von: Hiroshi Inoue > An: Jan-Peter Seifert > CC: pgsql-odbc@postgresql.org > Betreff: Re: [ODBC] Problem with high OIDs because of changed atol behaviour > Hi, > > (2011/01/15 0:00), Jan-Peter Seifert wrote: > > Hello, > > > > we ran into a problem because a Windows 32 bit application is looking > for rows within the tables of pg_catalog via OID - using psqlODBC (32 bit). > > As OIDs are unsigned they can be of higher value than INT_MAX. However, > OIDs greater than INT_MAX seem to be getting clamped to INT_MAX: > > http://archives.postgresql.org/pgsql-admin/2011-01/msg00003.php > > > > The problem still persists in psqlodbc 09.00.0200. > > > > We had a look at the sources of v08.04.0200 to get a clue: > > > > convert.c: > > > > /* > > * Macros for unsigned long handling. > > */ > > #ifdef WIN32 > > #define ATOI32U atol > > #elif defined(HAVE_STRTOUL) > > #define ATOI32U(val) strtoul(val, NULL, 10) > > #else /* HAVE_STRTOUL */ > > #define ATOI32U atol > > #endif /* WIN32 */ > > > > > > /* > > * Macros for BIGINT handling. > > */ > > #ifdef ODBCINT64 > > #ifdef WIN32 > > #define ATOI64 _atoi64 > > #define ATOI64U _atoi64 > > #define FORMATI64 "%I64d" > > #define FORMATI64U "%I64u" > > #elif (SIZEOF_LONG == 8) > > … > > > > It seems that as of Microsoft Visual C++ 2005 values exceeding the > positive integer limit let atol return LONG_MAX and values exceeding the > negative integer limit let atol return LONG_MIN. > > In case of these overflows errno is set to ERANGE. If the parameter that > has been passed is NULL, the invalid parameter handler is being invoked - > as described in parameter validation. > > If resuming of execution is allowed these functions set errno to EINVAL > and return 0. > > > > In Microsoft Visual C++ 2003 (and earlier versions) there was no such > error handling of these overflows. > > > > We suggest some changes within convert.c that might solve this problem: > > > > /* > > * Macros for unsigned long handling. > > */ > > #ifdef WIN32 > > #define ATOI32U(val) strtoul(val, NULL, 10) > > #elif defined(HAVE_STRTOUL) > > #define ATOI32U(val) strtoul(val, NULL, 10) > > #else /* HAVE_STRTOUL */ > > #define ATOI32U atol > > #endif /* WIN32 */ > > > > > > /* > > * Macros for BIGINT handling. > > */ > > #ifdef ODBCINT64 > > #ifdef WIN32 > > #define ATOI64(val) _strtoi64(val, NULL, 10) > > #define ATOI64U(val) _strtoui64(val, NULL, 10) > > #define FORMATI64 "%I64d" > > #define FORMATI64U "%I64u" > > #elif (SIZEOF_LONG == 8) > > … > > > > Could look into this, please? > > Thanks for your investigation. > I would take of it. > > regards, > Hiroshi Inoue -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail