summaryrefslogtreecommitdiff
path: root/mysqlc
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
parent96953171bf0503a89611b7c518668f749fe14425 (diff)
fdo#70496 revert to using libmysqlclient
Change-Id: I5b98b5e7840e4f1c6005aee0c1f43ef814ecf77b
Diffstat (limited to 'mysqlc')
-rw-r--r--mysqlc/Extension_mysql-connector-ooo.mk6
-rw-r--r--mysqlc/Library_mysqlc.mk2
-rw-r--r--mysqlc/source/mysqlc_driver.cxx23
-rw-r--r--mysqlc/source/mysqlc_driver.hxx4
4 files changed, 34 insertions, 1 deletions
diff --git a/mysqlc/Extension_mysql-connector-ooo.mk b/mysqlc/Extension_mysql-connector-ooo.mk
index 810ede57ad78..d94905745271 100644
--- a/mysqlc/Extension_mysql-connector-ooo.mk
+++ b/mysqlc/Extension_mysql-connector-ooo.mk
@@ -26,4 +26,10 @@ ifeq ($(SYSTEM_MYSQL_CPPCONN),NO)
$(eval $(call gb_Extension_add_library,mysql-connector-ooo,mysqlcppconn))
endif
+ifeq ($(BUNDLE_MARIADB),YES)
+$(eval $(call gb_Extension_add_files,mysql-connector-ooo,,\
+ $(LIBMARIADB_PATH)/$(LIBMARIADB) \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/mysqlc/Library_mysqlc.mk b/mysqlc/Library_mysqlc.mk
index 72787fc1855b..00c35e300bea 100644
--- a/mysqlc/Library_mysqlc.mk
+++ b/mysqlc/Library_mysqlc.mk
@@ -42,6 +42,8 @@ $(eval $(call gb_Library_add_defs,mysqlc,\
-DMARIADBC_VERSION_MICRO=$(MARIADBC_MICRO) \
$(if $(filter NO,$(SYSTEM_MYSQL_CPPCONN)),\
-DCPPCONN_LIB=\"$(call gb_Library_get_runtime_filename,mysqlcppconn)\") \
+ $(if $(filter YES,$(BUNDLE_MARIADB)),\
+ -DBUNDLE_MARIADB=\"$(LIBMARIADB)\") \
))
$(eval $(call gb_Library_add_exception_objects,mysqlc,\
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