64 bit ODBC driver does not work in Kubuntu [ODBC76] #75
Submitted by: Steve Cookson (steve_bz)
Summary: I suspect the code just needs recompiling for a 64-bit architecture.
After initial problems I finally got ODBC working. But I have repeated problems with the date format (and quite possibly the integer format too). The database was created in a UK locale and Kubuntu is set to a UK locale.
I have a row containing a date field which I read once with the Perl application and I get '30/07/2009'. I read it again later and get, say, '32231-08-2\x00'. Sometimes the read works and sometimes not. Sometimes I get a valid date and sometimes I get a strange string, but always with the format nnnnn-nn-n\x00.
If I use isql-fb, it works perfectly, but if I use just isql (the ODBC product), it fails. So this leads me to believe it's an ODBC issue Here is an example, if I don't use any code but just use isql and I run the same query (select att_examination_dte from tbl_exam) three times, I get record 1 = 31893-11-15, twice and record 1 = 2009-07-24 (the correct value) the third time. There are 21 records in this table, here is the whole output (see below).
steve@steve-desktop:~$ isql end_db
The text was updated successfully, but these errors were encountered:
Commented by: Ralf Friedl (ralffriedl)
I'm not sure whether it makes sense to add a comment to an issue that has not been addressed for almost three years, but I'll do it anyway.
In the ODBC driver the 64-bit support is more or less broken. The main problem is the assumption that sizeof (long) == 4. The solution would be to use the types int32_t or uint32_t.
This particular issue is caused by the definition of LO_LONG in OdbcConvert.cpp:
There are many more places in OdbcConvert.cpp where long should be replaced with int32_t, or even with int, as long as nobody tries to compile it on a 16 bit system.