Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 bit ODBC error connecting from OpenOffice (isql is ok) [ODBC68] #67

Closed
firebird-automations opened this issue Jun 6, 2009 · 12 comments

Comments

@firebird-automations
Copy link

Submitted by: Federico Ghigo (fedebra)

Attachments:
libOdbcFb.so.bz2

Votes: 2

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.

@firebird-automations
Copy link
Author

Modified by: Federico Ghigo (fedebra)

description: 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).
Thanks for any interest on my problem.

=>

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.

@firebird-automations
Copy link
Author

Commented by: Dero (dero)

I report the same issue on opensuse11.1 64 with openoffice 3.1.1

@firebird-automations
Copy link
Author

Commented by: Federico Ghigo (fedebra)

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....

@firebird-automations
Copy link
Author

Commented by: Ivan Volnikov (ivan_v)

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.

@firebird-automations
Copy link
Author

Commented by: Federico Ghigo (fedebra)

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 ?

@firebird-automations
Copy link
Author

Commented by: Ivan Volnikov (ivan_v)

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 http://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.

@firebird-automations
Copy link
Author

Commented by: Ivan Volnikov (ivan_v)

I attach myself compiled driver. It is to work in x86_64 Linux System under http://2.6.xxx kernel.

@firebird-automations
Copy link
Author

Modified by: Ivan Volnikov (ivan_v)

Attachment: libOdbcFb.so.bz2 [ 11651 ]

@firebird-automations
Copy link
Author

Commented by: Federico Ghigo (fedebra)

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.

@firebird-automations
Copy link
Author

Commented by: Ivan Volnikov (ivan_v)

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

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0 RC2 [ 10320 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant