Issue Details (XML | Word | Printable)

Key: ODBC-68
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Federico Ghigo
Votes: 2
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
ODBC Driver

64 bit ODBC error connecting from OpenOffice (isql is ok)

Created: 06/Jun/09 04:28 PM   Updated: 12/Feb/11 01:02 PM
Component/s: None
Affects Version/s: 2.0 RC1
Fix Version/s: 2.0 RC2

File Attachments: 1. File libOdbcFb.so.bz2 (457 kB)

Environment: Ubuntu Linux 64 bit (both on 8.10 and 9.04)


 Description  « Hide
I setup an ODBC connection to fb database and via the unixodbc isql tool I can connect correctly and do queries.
When I try to connect via OpenOffice (both version 2 and 3), after I log on at the password window, I get the error: "[unixODBC][ODBC Firebird Driver]Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long"; Via the unixodbc log I can't see anything logged (it is enabled and woks, when I get connected via isql). OpenOffice ODBC works well with other drivers for other databases (ie mysql).
Thanks for any interest on my problem.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dero added a comment - 08/Sep/09 02:22 AM
I report the same issue on opensuse11.1 64 with openoffice 3.1.1

Federico Ghigo added a comment - 27/Apr/10 09:20 AM
Still same error....even with Ubuntu 10.04; I would like to receive some updates but this thread seems dead...after all it's an issue with openoffice, a diffused suite....

Ivan Volnikov added a comment - 17/Jun/10 06:29 AM - edited
I am find the same problem in Asterisk PBX RealTime application under 64 bit RH Linux. "[unixODBC][ODBC Firebird Driver]Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long". Opening has shown presence to an error in "isc_dpb_connect_timeout" parameter transmission from ODBC Firebird driver to the Firebird client. The matter is that in the ODBC Firebird Driver src-file "../IscDbc/Attachment.ccp" starting at the line 218 (cvs source code from 11 Jun 2010) there is code:
[...
const char *timeout = properties->findValue ("timeout", NULL);

if (timeout && *timeout)
{
connectionTimeout = atoi(timeout);

*p++ = isc_dpb_connect_timeout;
*p++ = sizeof (long);
*p++ = (char)connectionTimeout;
*p++ = (char)(connectionTimeout >> 8);
*p++ = (char)(connectionTimeout >> 16);
*p++ = (char)(connectionTimeout >> 24);
}
...]
In 32 bit Systems sizeof (long)==4, but 64 bit System sizeof (long)==8 !!!
I pay attention that in "p" place 4 bytes only. And Firebird/Interbase client wait 0..4 bytes using method:
[...
SLONG ClumpletReader::getInt() const
{
const UCHAR* ptr = getBytes();
size_t length = getClumpLength();

if (length > 4) {
invalid_structure("length of integer exceeds 4 bytes");
return 0;
}

// This code is taken from gds__vax_integer
SLONG value = 0;
int shift = 0;
while (length > 0) {
--length;
value += ((SLONG) *ptr++) << shift;
shift += 8;
}

return value;
}
...]
For this reason to FIX this truble in the "../IscDbc/Attachment.ccp" at line 225:
[..
*p++ = sizeof (long);
..] need replace on:
[..
*p++ = 4;
..]
That code realy do work both on 32, and on 64 bit Systems.
The reason on which not in all applications the given error that attribute SQL_ATTR_LOGIN_TIMEOUT install not all appears. The Asterisk PBX, OpenOffice 3.1.1 do it. I researched their source codes on this subject.

Federico Ghigo added a comment - 17/Jun/10 05:46 PM
Ivan, thank you for the post...I'm sorry to bother you. I've been trying for a while to compile from source but I'm unable (I have the gcc 4.4.3 of Ubuntu 10.04 + unixodbc-dev installed); when I go in /builds/Gcc.lin/ and type make -f makefile.linux I get a lot of errors from the original source packet too.
Can you pls help me on building it or tell me where can I find a compiled one ?

Ivan Volnikov added a comment - 18/Jun/10 11:35 AM - edited
Hey, Federico. ODBC driver for Firebird is the bridge between host ODBC driver (unixodbc in this time) and the Firebird/Interbase client library. To compile the libOdbcFb.so module you need to install the firebird-devel.x86_64 package on your x86-64 Linux System also. Still it is necessary to be convinced that the firebird-libfbclient.x86_64 package is installed if you did not have placed Firebird server there. It is not necessary for compile but needs to work.

Ivan Volnikov added a comment - 18/Jun/10 01:28 PM
I attach myself compiled driver. It is to work in x86_64 Linux System under 2.6.xxx kernel.

Federico Ghigo added a comment - 25/Jun/10 08:09 AM
Ivan, thank you for the attachment, I tried it, it works ok with unixodbc, but when I connect via OpenOffice I get no errors but the application hangs and after some seconds the system starts using intensively the disk (even if I don't see swapfile grow) until it hangs. I use Ubuntu 10.04 with kernel 2.6.32-22-generic, it shouldn't happen since it's always 2.6....any idea ? Thank you in advance.

Ivan Volnikov added a comment - 02/Jul/10 12:49 PM
Federico, test your SQL script without ODBC or try write more simpler. You may attach backup and I try it in my system. I think ODBC and Ubuntu do not matter