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

Data corrupted in Libre Base on Fedora 64 bit [ODBC141] #138

Closed
firebird-automations opened this issue Mar 1, 2012 · 4 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: Sasha (sasha)

Greetings. Thanks for so useful for many people driver. It works good in almost all situations. But in one situation appears problem:
in Libre Base on Fedora 64 bit contents of some tables appears corrupted, with other tables Base crashes.

Bugreport about this in LibreOffice bugtracker: https://bugs.freedesktop.org/show_bug.cgi?id=45881

Resolution of expert:
That's a driver bug. The driver uses the C/C++ dataype "long" for the SQL
datatype "Integer" and for ODBC C type identifier SQL_C_SLONG. It should use
the ODBC C typedef of SQLINTEGER for that, which depending on platforms will be
"int" or "long" or even (theoretically) something else.

Integer / SQL_INTEGER / SQL_C_SLONG / SQLINTEGER is a 32 bit integer.
On Windows (32 bit or 64 bit), long == int == 32 bit integer, so one can use
"long" or "int" interchangeably and the bug does not appear.
On most modern 32 bit Unices, long == int == 32 bit integer, so again the bug
does not appear.
On most modern 64 bit Unices, int == 32 bit integer and long == 64 bit integer,
so not the same one => need to use the right one.

That's why UnixODBC has:

#⁠if (SIZEOF_LONG_INT == 8)
typedef int SQLINTEGER;
#⁠else
typedef long SQLINTEGER;
#⁠endif

See also

http://msdn.microsoft.com/en-us/library/windows/desktop/ms714556%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms713979%28v=vs.85%29.aspx
-----------------------end of cite--------------------------------------------------------------------------------------

some additional information about my experiments: https://bugs.freedesktop.org/show_bug.cgi?id=34432

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Try 2.0.1 version please

@firebird-automations
Copy link
Author

Commented by: Sasha (sasha)

In version 2.0.1 still reproducible

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0.3 [ 10581 ]

@firebird-automations
Copy link
Author

Commented by: Sasha (sasha)

Thanks for fixing this bug

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

2 participants