summaryrefslogtreecommitdiff
path: root/mysqlc/source
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-10-19 22:57:40 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-10-19 23:03:14 +0200
commit02a11749da521e8e2099b464c0fcbebce9e95e22 (patch)
treee7e9b5bac422843ae8b031f9b59f4769e81a4845 /mysqlc/source
parent96953171bf0503a89611b7c518668f749fe14425 (diff)
fdo#70496 revert to using libmysqlclient
Change-Id: I5b98b5e7840e4f1c6005aee0c1f43ef814ecf77b
Diffstat (limited to 'mysqlc/source')
-rw-r--r--mysqlc/source/mysqlc_driver.cxx23
-rw-r--r--mysqlc/source/mysqlc_driver.hxx4
2 files changed, 26 insertions, 1 deletions
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