[egenix-users] real 64-bit mxodbc zope da package?

M.-A. Lemburg mal at egenix.com
Tue Nov 15 18:17:28 CET 2011

Andrew Altepeter wrote:
> Greetings,
> I am trying to run on opensuse 11.4 64-bit:
> egenix mxodbc zope da 2.0.1
> oracle-instantclient11.2-basic-
> oracle-instantclient11.2-odbc-
> Background: I've been using oracle instance client + unixodbc + egenix
> mxodbc zope da for years, but in 32 bit.  Oracle instantclient (even going
> back to uses "real 64-bit" strings.
> Suse's delivered 64-bit unixodbc is version 2.2.12.  With the stock ini
> files configured properly, I can use isql to connect to my oracle server,
> and run queries.  The strings returned from the queries are all blank, I
> think due to the fact that this version of unixodbc uses 32-bit strings.
> I compiled unixodbc 2.3.0 from source, configured it's odbc ini files in
> exactly the same way.  When I connect to the oracle server using this
> versions isql, strings returned from queries are no longer blank -- they
> have the correct values in them.  In short, I think unixodbc 2.3.0 and
> instanceclient 64-bit are the correct match.
> Now  I move in to zope, with mxzopeda 2.0.1 installed.  I go to my database
> adapter.
> When using unixodbc 2.2.12, the database adapter's manage_main loads, says
> one connection is open.  I go to the test tab and run a query, strings are
> returned blank.
> When using unixodbc 2.3.0, I get segfaults.  Visiting the DA's manage_main
> sometimes segfaults, but using the test tab will always segfault.

That's due to a rather major change in the unixODBC ABI between versions
2.2 and 2.3 which affects 64-bit platforms (the SQLLEN type was changed
from 32-bit to 64-bit).

Unfortunately, unixODBC chose not to change the lib version, so there's no
protection against such segfaults - mxODBC 3.0 will happily link against
a unixODBC 2.3 lib even though it was compiled against unixODBC 2.2.

> I've combed through the egenix-users mailing lists, and learned a few
> things:
> http://www.egenix.com/mailman-archives/egenix-users/2008-June/114412.html
> http://permalink.gmane.org/gmane.comp.python.egenix.user/1547<http://osdir.com/ml/python.egenix.user/2008-06/msg00005.html>
> http://osdir.com/ml/python.egenix.user/2008-06/msg00005.html
> The latter I found most revealing, in particular:
>> This would lead to a segfault when used with the mx.ODBC.unixODBC
>> package we provide, since in "REAL 64bit" mode, unixODBC doesn't
>> follow the MS ODBC standard. It uses the native 64-bit support
>> and bit lengths on Linux instead.

That was true before MS decided to go with the flow and actually
use 64-bit length information for ODBC on their Windows x64 systems.
The ODBC standard previously mandated "long" to be used for length
information, which is a 32-bit integer on Windows x64 systems.

> I think the segfault is due to mxodbc expecting strings to be 32 bit, while
> unixodbc/instantclient is delivering 64 bit strings.  While a few years
> old, the message quote above leads me to think that the mx.ODBC.unixODBC
> package you provide could be recompiled to provide "real 64bit" mode
> support.  Is this possible?
> Or, what is the current state of 64 bit odbc support from egenix?

Our current mxODBC 3.1 release does support unixODBC 2.3, but the
mxODBC Zope DA 2.0 still runs on mxODBC 3.0 which only supports unixODBC 2.2
on 64-bit platforms.

> I also read in another post (which I can't find now) that Microsoft changed
> the odbc standard for 64 bit late in the game, switching from 32-bit to
> 64-bit strings after the unix odbc support had implemented 32 bit strings.
>  As it stands, since instantclient appears to support (only) the "real 64
> bit" strings, I can't using mxodbc with it in 64 bit linux.

The next version mxODBC Zope DA 2.1 will support unixODBC 2.3.0 and
use mxODBC 3.1 (or 3.2) under the hood.

If you'd like a pre-release copy, we can send you an eval key.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 15 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the egenix-users mailing list