This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 559fc678af Add support for iODBC on *nix.
559fc678af is described below
commit 559fc678afa1e0758f8514b5b7514953e13a4ef4
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Fri Jun 26 19:55:17 2026 +0200
Add support for iODBC on *nix.
On *nix (Linux and FreeBSD), instead of only trying to load the
unixODBC driver manager, try that first but fall back to iODBC's
driver manager otherwise. These platforms have both, and we can
use both, and only use iODBC on Mac, so there's no point in
avoiding iODBC on *nix.
Fixes: https://bz.apache.org/ooo/show_bug.cgi?id=128632
---
main/connectivity/source/drivers/odbc/OFunctions.cxx | 7 +++++++
main/dbaccess/source/ui/dlg/odbcconfig.cxx | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/main/connectivity/source/drivers/odbc/OFunctions.cxx
b/main/connectivity/source/drivers/odbc/OFunctions.cxx
index c6968b8163..727c74068c 100644
--- a/main/connectivity/source/drivers/odbc/OFunctions.cxx
+++ b/main/connectivity/source/drivers/odbc/OFunctions.cxx
@@ -112,10 +112,17 @@ sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath)
#ifdef MACOSX
_rPath = ::rtl::OUString::createFromAscii("libiodbc.dylib");
#else
+ // Try unixODBC first, since we have a long history of only using it:
_rPath = ::rtl::OUString::createFromAscii("libodbc.so.1");
pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
if ( !pODBCso )
+ {
_rPath = ::rtl::OUString::createFromAscii("libodbc.so");
+ pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
+ // If no unixODBC, try iODBC instead:
+ if ( !pODBCso )
+ _rPath =
::rtl::OUString::createFromAscii("libiodbc.so");
+ }
#endif /* MACOSX */
#endif
#ifdef OS2
diff --git a/main/dbaccess/source/ui/dlg/odbcconfig.cxx
b/main/dbaccess/source/ui/dlg/odbcconfig.cxx
index 96bd57a1e5..ac95b4b8b4 100644
--- a/main/dbaccess/source/ui/dlg/odbcconfig.cxx
+++ b/main/dbaccess/source/ui/dlg/odbcconfig.cxx
@@ -69,6 +69,8 @@
#define ODBC_UI_LIBRARY_1 "libodbcinst.so.1"
#define ODBC_LIBRARY "libodbc.so"
#define ODBC_UI_LIBRARY "libodbcinst.so"
+#define ODBC_LIBRARY_2 "libiodbc.so"
+#define ODBC_UI_LIBRARY_2 "libiodbcinst.so"
#endif
#endif
@@ -216,6 +218,10 @@ OOdbcEnumeration::OOdbcEnumeration()
if ( !bLoaded )
bLoaded = load(ODBC_LIBRARY_1);
#endif
+#ifdef ODBC_LIBRARY_2
+ if ( !bLoaded )
+ bLoaded = load(ODBC_LIBRARY_2);
+#endif
if ( bLoaded )
{