From 02a11749da521e8e2099b464c0fcbebce9e95e22 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Sat, 19 Oct 2013 22:57:40 +0200 Subject: fdo#70496 revert to using libmysqlclient Change-Id: I5b98b5e7840e4f1c6005aee0c1f43ef814ecf77b --- mysqlc/source/mysqlc_driver.cxx | 23 ++++++++++++++++++++++- mysqlc/source/mysqlc_driver.hxx | 4 ++++ 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'mysqlc/source') diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx index abd29776ba03..f6181e70ff74 100644 --- a/mysqlc/source/mysqlc_driver.cxx +++ b/mysqlc/source/mysqlc_driver.cxx @@ -143,9 +143,30 @@ void MysqlCDriver::impl_initCppConn_lck_throw() #ifdef SYSTEM_MYSQL_CPPCONN cppDriver = get_driver_instance(); #else +#ifdef BUNDLE_MARIADB + if ( !m_bAttemptedLoadCConn ) + { + const OUString sModuleName(BUNDLE_MARIADB); + m_hCConnModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 ); + m_bAttemptedLoadCConn = true; + } + + // attempted to load - was it successful? + if ( !m_hCConnModule ) + { + OSL_FAIL( "MysqlCDriver::impl_initCppConn_lck_throw: could not load the " BUNDLE_MARIADB " library!"); + throw SQLException( + OUString( "Unable to load the " BUNDLE_MARIADB " library." ), + *this, + OUString( "08001" ), // "unable to connect" + 0, + Any() + ); + } +#endif if ( !m_bAttemptedLoadCppConn ) { - const OUString sModuleName(CPPCONN_LIB ); + const OUString sModuleName(CPPCONN_LIB); m_hCppConnModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 ); m_bAttemptedLoadCppConn = true; } diff --git a/mysqlc/source/mysqlc_driver.hxx b/mysqlc/source/mysqlc_driver.hxx index 0c14e8a3cb81..d63ed055e6f0 100644 --- a/mysqlc/source/mysqlc_driver.hxx +++ b/mysqlc/source/mysqlc_driver.hxx @@ -63,6 +63,10 @@ namespace connectivity // of all the Connection objects // for this Driver #ifndef SYSTEM_MYSQL_CPPCONN +#ifdef BUNDLE_MARIADB + oslModule m_hCConnModule; + bool m_bAttemptedLoadCConn; +#endif oslModule m_hCppConnModule; bool m_bAttemptedLoadCppConn; #endif -- cgit v1.2.3