Issue 23: Issue with 64-bit Linux
Status:  Complete
Owner: ----
Closed:  Nov 2010
Reported by axel.b.k...@googlemail.com, Jan 8, 2009
On my 64-bit Kubuntu Linux box I enyounter the following problem:

Decimal-values with NULL-value produce an exception when reading. This
happens because in src/getdata.cpp, function GetDataDecimal, the variable
cbFetched is of type SQLLEN which is 64 bits long. The return value -1 for
a NULL value is a 32 bit number, so it is not -1 in 64 bits and the
function tries to convert the empty string '' to a decimal which raises an
exception.

Possible solution to the problem: cbFetched must be of a 32-bit type,
regardless of the systems bit size. I am sorry, but I don't know, which
type could be the right one for this.

Regards, Axel
Mar 18, 2009
Project Member #1 mkleehammer
I'm at a loss here: cbFetched really needs to be a SQLLEN -- we're passing a pointer
to a 8-bytes of memory (SQLLEN*) so it would be bad if the memory only contained 4-bytes.

I assume you are using unixODBC?  It allows you to set SIZEOF_LONG, so if the driver
and the driver-manager were compiled with different values, you might see this
behavior.  (Incidentally, what kind of whacked out option is that, changing the size
of long? ;)

What version of unixODBC are you using?  I'll look through their header files and see
what we can do.
Status: Investigating
Mar 21, 2009
#2 axel.b.k...@googlemail.com
I am using unixODBC 2.2.11-16build2  on Kubuntu 8.10.

Regards, Axel
Sep 6, 2010
Project Member #3 mkleehammer
Can you try this with 2.1.8?

Thanks.

Nov 21, 2010
Project Member #4 mkleehammer
Closing due to inactivity.  I think these issues are cleared up in 2.1.8+
Status: Complete
Mar 31, 2014
#5 jordanth...@gmail.com
This issue is still happening for me; I'm using unixODBC-2.2.11 and latest version of pyodbc. Code to recreate attached; server is running CentOS 5.9.
pyodbc-bus-error.py
1.5 KB   View   Download
Apr 1, 2014
#6 jordanth...@gmail.com
Just updated unixODBC to latest version; error still occurs.