X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A954A475A1E for ; Tue, 4 Feb 2003 22:10:39 -0500 (EST) Received: from HARRIS.memetrics.local (unknown [61.8.29.11]) by postgresql.org (Postfix) with ESMTP id 60DA847595A for ; Tue, 4 Feb 2003 22:10:38 -0500 (EST) Received: from outback.memetrics.local ([192.168.10.203]) by HARRIS.memetrics.local with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id D27DGN1D; Wed, 5 Feb 2003 14:15:53 +1100 Received: (from ap@localhost) by outback.memetrics.local (8.11.6/8.8.7) id h153Af105414; Wed, 5 Feb 2003 14:10:41 +1100 X-Authentication-Warning: outback.memetrics.local: ap set sender to Alain.Picard@memetrics.com using -f From: Alain Picard MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15936.32945.34098.651127@outback.memetrics.local> Date: Wed, 5 Feb 2003 14:10:41 +1100 (EST) To: Hiroshi Inoue Cc: Alain Picard , pgsql-odbc@postgresql.org Subject: Re: unixODBC, PostgreSQL 7.3 + ODBC V3 drivers? In-Reply-To: <3E40697F.646ACF10@tpf.co.jp> References: <15935.11848.278897.343335@outback.memetrics.local> <3E3F8C0B.C6E195DA@tpf.co.jp> <15936.16797.475953.234542@outback.memetrics.local> <3E405CB2.6163F291@tpf.co.jp> <15936.26434.443355.676365@outback.memetrics.local> <3E40697F.646ACF10@tpf.co.jp> X-Mailer: VM 6.75 under Emacs 20.7.1 X-Attribution: ap Comment: No comment. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/23 X-Sequence-Number: 2641 >>>>> Hiroshi Inoue writes: Hiroshi> I've just committed a change(odbcapi.c) to cvs. Hiroshi> Please try. Hiroshi, it works like a charm. There's still a bug remaining, however, when connecting to a postgresql 7.3 back end; it's not handling the BIGINTs properly. Here is a patch, for convert.c. You need to remove the #ifdef WIN32 in the code below, because we now want to execute this code on unix as well: #if (ODBCVER >= 0x0300) && defined(ODBCINT64) /* #ifdef WIN32 */ case SQL_C_SBIGINT: len = 8; if (bind_size > 0) *(SQLBIGINT *) ((char *) rgbValue + (bind_row * bind_size)) = _atoi64(neut_str); else *((SQLBIGINT *) rgbValue + bind_row) = _atoi64(neut_str); break; case SQL_C_UBIGINT: len = 8; if (bind_size > 0) *(SQLUBIGINT *) ((char *) rgbValue + (bind_row * bind_size)) = _atoi64(neut_str); else *((SQLUBIGINT *) rgbValue + bind_row) = _atoi64(neut_str); break; /* #endif */ /* WIN32 */ #endif /* ODBCINT64 */ And then you need to add #ifndef WIN32 #define _atoi64 atoll #endif somewhere at the top of that file because _atoi64 doesn't exist under linux. If you're not using GCC, or are on a system which doesn't support `atoll', this will break; you can adjust the #define dance as you wish to support other platforms, if you know how they behave. (I don't). Also, the code above seems to be wrong for SQL_C_UBIGINT; I doubt that _atoi64 (or atoll) will return an unsigned long long for a number above 2^63. Thank you so much for your _invaluable_ help. -- Alain Picard Memetrics